]> git.proxmox.com Git - pve-storage.git/commit
storage plugins: en/decode volume notes as UTF-8
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 9 Mar 2022 08:21:28 +0000 (09:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Apr 2022 13:33:13 +0000 (15:33 +0200)
commit43f8112f0bb424f99057106d57d32276d7d422a6
treef651b7745c4fdfe5ce93d06fac15c1f819a29b2a
parent7a8751a2cd9255ff4d26cd96e21b26fc64c83706
storage plugins: en/decode volume notes as UTF-8

When writing into the file, explicitly utf8 encode it, and then try
to utf8 decode it on read.

If the notes are not valid utf8, we assume they were iso-8859 encoded
and return as is.

Technically this is a breaking change, since there are iso-8859
comments that would successfully decode as utf8, for example: the
byte sequence "C2 A9" would be "£" in iso, but would decode to "£".

From what i can tell though, this is rather unlikely to happen for
"real world" notes, because the first byte would be in the range of
C0-F7 (which are mostly language dependent characters like "Â") and
the following bytes would have to be in the range of 80-BF, which are
only special characters like "£" (or undefined)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/Storage/DirPlugin.pm
PVE/Storage/Plugin.pm