aboutsummaryrefslogtreecommitdiff
path: root/lib/ucs2_string.c
AgeCommit message (Collapse)AuthorFilesLines
2016-02-16lib/ucs2_string: Correct ucs2 -> utf8 conversionJason Andryuk1-7/+7
The comparisons should be >= since 0x800 and 0x80 require an additional bit to store. For the 3 byte case, the existing shift would drop off 2 more bits than intended. For the 2 byte case, there should be 5 bits bits in byte 1, and 6 bits in byte 2. Signed-off-by: Jason Andryuk <[email protected]> Reviewed-by: Laszlo Ersek <[email protected]> Cc: Peter Jones <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: "Lee, Chun-Yi" <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
2016-02-10lib/ucs2_string: Add ucs2 -> utf8 helper functionsPeter Jones1-0/+62
This adds ucs2_utf8size(), which tells us how big our ucs2 string is in bytes, and ucs2_as_utf8, which translates from ucs2 to utf8.. Signed-off-by: Peter Jones <[email protected]> Tested-by: Lee, Chun-Yi <[email protected]> Acked-by: Matthew Garrett <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
2013-04-15Move utf16 functions to kernel core and renameMatthew Garrett1-0/+51
We want to be able to use the utf16 functions that are currently present in the EFI variables code in platform-specific code as well. Move them to the kernel core, and in the process rename them to accurately describe what they do - they don't handle UTF16, only UCS2. Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: Matt Fleming <[email protected]>