[parted-devel] [PATCH] GPT strings are UCS-2LE not UTF-16
H. Peter Anvin
hpa at zytor.com
Mon Mar 23 16:21:46 UTC 2015
On 03/23/2015 08:29 AM, Brian C. Lane wrote:
> On Sun, Mar 22, 2015 at 09:20:23PM -0400, Phillip Susi wrote:
>> On 03/21/2015 11:32 AM, H. Peter Anvin wrote:
>>> It isn't about the UEFI spec but rather what iconv expects. The
>>> string "UTF-16LE" produces littleendian UTF-16 without BOM.
>>
>> Right, and that is exactly what Brian said it should be, I believe
>> because the UEFI spec states that it is LE, so there is no need for
>> the BOM. What I'm not sure about is the difference between UCS-2 and
>> UTF-16.
>
> The UEFI spec is for UCS-2, and everything in GPT is stored in LE so
> that's what I used. Are you seeing a problem with the iconv_open call on
> some distributions?
>
The difference is that characters above U+FFFF are an error in UCS-2 but
uses surrogates in UTF-16. I believe falling back to surrogates is the
right thing to do, even if it is not 100% spec compliant.
-hpa
More information about the parted-devel
mailing list