-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cygwin #11238
base: master
Are you sure you want to change the base?
Support cygwin #11238
Conversation
d5ec927
to
16fbfdb
Compare
16fbfdb
to
b26cf23
Compare
d132e40
to
a100316
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine by me, I think @ridiculousfish would like to take a look.
Awesome work, btw
#[cfg(target_os = "cygwin")] | ||
{ | ||
// No system wcwidth for UTF-32 on cygwin. | ||
0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be Ambiguous instead of 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are 0 in cygwin. You can see in the following code that it returns 0 for non-spacing characters.
https://github.com/cygwin/cygwin/blob/main/newlib/libc/string/wcwidth.c
We don't use the cygwin wcwidth
function because it's UTF-16.
Description
This PR adds support for Cygwin & MSYS2.
wchar_t
is UTF-16.wcwidth
isreplaced byremoved.unicode-width
.wcrtomb
andmbrtowc
are replaced byc32rtomb
andmbrtoc32
.Fixes issue #10956, though it has been closed.
Tracking:
TODO: