[pve-devel] applied: [PATCH storage] Plugins: en/decode notes as UTF-8
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Apr 26 15:36:45 CEST 2022
On 09.03.22 09:21, Dominik Csapak wrote:
> 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 it was an iso-8859 comment
> and return is at is was.
>
> Technically this is a breaking change, since there are iso-8859 comments
> that would sucessfully 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 at proxmox.com>
> ---
> PVE/Storage/DirPlugin.pm | 9 +++++++--
> PVE/Storage/Plugin.pm | 3 ++-
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
>
applied, with commit message typos (there where at least one other) fixed, thanks!
More information about the pve-devel
mailing list