-
Notifications
You must be signed in to change notification settings - Fork 145
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
parse-namestring
doesn't accept unicode
#1595
Comments
Yes, a base-string is an array of base-chars, and base-chars are one byte, Latin-1 or something. The coercion is done here: Lines 1349 to 1351 in 9585462
The underlying parser in clasp_parseNamestring doesn't seem to actually be limited to byte characters on first glance, so maybe this will be easy to fix. |
Nope, not that simple. |
Note that this is NOT a complete solution to #1595, as the actual OS interface (calls to open(3), etc.) is not really prepared for non-base-strings. It will probably have to do some encoding.
Perhaps an innocent "ASCII will do for now" kind of thought, the lingering effects of which we're seeing here. Thanks for tackling this. |
Support extended characters in pathnames. Fixes #1595.
I will test your fix locally as well. |
Please do. I think I got it working, but I might have missed some of the more obscure filesystem access functions. |
As far as my tests are concerned, your fixes work. Thank you! |
Describe the bug
If we inspect the string
"/foo/bar/ゆびわ"
, we see:Wonderful. However, if we attempt to include a unicode character in a pathname, like
(parse-namestring "/foo/bar/ゆびわ")
, the debugger opens and we're told:Somewhat cryptic. However,
base-string
is a hint, and the Clasp docs also mention:So perhaps somewhere in the depths of parsing the path, characters are assumed to be non-Unicode and a conversion to
base-string
(probably an array ofbase-char
?) is attempted.Expected behavior
It should be possible to contain Unicode characters with pathnames, as people in non-English-speaking countries often have Unicode characters in filepaths on their computers.
Actual behavior
(shown above)
Note also that this occurs for
#p
literals as well (probably powered byparse-namestring
underneath).The text was updated successfully, but these errors were encountered: