in reply to Saving file name with Chinese characters
Unix interprets file names as series of characters in the current locale's encoding, often UTF-8. I don't know how to get the correct encoding, but you could look at how the open pragma does it. Encode's encode can be used to encode the file name once you know the encoding.
Windows uses UCS-2le internally. As such, it supports all Unicode characters in BMP0 (those up to U+FFFF). However, Perl doesn't use the system call capable of handling those characters. You'll need to create or open the file using Win32API::File's CreateFileW. CreateFileW expects you to encode the file name yourself (using UCS-2le).
Update: I wasn't sure if Windows used UCS-2le or UTF-16le, so I put it to the test. It won't let me create a file with U+10000 in its name, ruling out UTF-16le. I adjusted the above accordingly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Saving file name with Chinese characters
by Anonymous Monk on Apr 13, 2009 at 18:46 UTC | |
by ikegami (Patriarch) on Apr 13, 2009 at 19:03 UTC | |
by Anonymous Monk on Apr 14, 2009 at 03:42 UTC | |
by ikegami (Patriarch) on Apr 14, 2009 at 04:10 UTC | |
|
Re^2: Saving file name with Chinese characters
by Anonymous Monk on Apr 13, 2009 at 23:56 UTC | |
by ikegami (Patriarch) on Apr 14, 2009 at 00:02 UTC |