[parted-devel] [PATCH] GPT strings are UCS-2LE not UTF-16

H. Peter Anvin hpa at zytor.com
Tue Mar 24 17:06:49 UTC 2015


On 03/24/2015 10:02 AM, Phillip Susi wrote:
> On 3/24/2015 12:41 PM, H. Peter Anvin wrote:
>> Most tools will probably simply pass them on.  Replacing them with
>> U+FFFD would corrupt existing data.
> 
> There is no such thing as "pass them on".  They must be interpreted
> somehow and typically converted to UTF-8.  And the whole idea is that
> any data written to the partition table that contains surrogates *is*
> corrupt.

If you read a partition table, and a partition entry you are not
modifying gets changed from surrogates to U+FFFD, that is corruption.

I suspect, but I don't know, that UCS-2 was specified before UTF-16 was
created.  It also means UEFI software isn't required to interpret
surrogates, and would typically display them as ?? or something like
that, which isn't really a problem.

	-hpa




More information about the parted-devel mailing list