Skip to content

BugFix: change out wchar_t type which is too narrow on Windows#7

Merged
ridiculousfish merged 1 commit intoridiculousfish:masterfrom
SlySven:BugFix_changeOutWChar_TTypeWhichIsTooNarrowOnWindows
Oct 30, 2019
Merged

BugFix: change out wchar_t type which is too narrow on Windows#7
ridiculousfish merged 1 commit intoridiculousfish:masterfrom
SlySven:BugFix_changeOutWChar_TTypeWhichIsTooNarrowOnWindows

Conversation

@SlySven
Copy link
Copy Markdown
Contributor

@SlySven SlySven commented Oct 30, 2019

Specifically it is only 16 bits and as we are using it to pass a Unicode codepoint it needs to have at least 21! This does mean however that any surrogate pairs i.e. UTF-16 encoded characters that are not on the BMP and are conveyed by TWO 16 bit values, MUST be converted to a UTF-32 value before being fed to (int) widechar_wcwidth(int32_t c)!

Signed-off-by: Stephen Lyons slysven@virginmedia.com

Specifically it is only 16 bits and as we are using it to pass a Unicode
codepoint it needs to have at least 21! This does mean however that any
surrogate pairs i.e. UTF-16 encoded characters that are not on the BMP
and are conveyed by TWO 16 bit values, MUST be converted to a UTF-32 value
before being fed to `(int) widechar_wcwidth(int32_t c)`!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@ridiculousfish ridiculousfish merged commit c87890e into ridiculousfish:master Oct 30, 2019
@ridiculousfish
Copy link
Copy Markdown
Owner

Thank you!

@SlySven SlySven deleted the BugFix_changeOutWChar_TTypeWhichIsTooNarrowOnWindows branch October 30, 2019 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants