The old storage handled this in ruby using force_encoding, see e.g. https://github.com/yast/yast-storage/blob/master_old/src/modules/Storage.rb#L5454.