[Code] UnicodeEx - (0.2.0a) Sketchup + Character Encoding
-
But that is an IO error. You're trying to create a new file with Unicode characters in the path.
You won't get around it by converting the string with the Unicode path to a different encoding - because the file is located under the folder named "Półka" and that's where you need to tell windows to look. Which means you need to give a Unicode string - which the ruby IO methods doesn't handle.
What you need is to call the Unicode APIs that creates a file. -
@thomthom said:
... Which means you need to give a Unicode string - which the ruby IO methods doesn't handle.
What you need is to call the Unicode APIs that creates a file.OK I agree with that.
It's the Fileand Dirclasses that STILLseem to have problems on Windows, even for Ruby ver 1.9.1
see this bug report
(I'd think the easiest solution would be to add a new parameter to many of the File and Dir class methods, ie "ANSI|UNICODE" for the mswin32 edition, that would give ruby coders a 'high-level' ruby way of forcing which API call to use, [ie: Ansi or Wide] without having to resort to direct API calls.)By the way several people have created unicode libraries (extensions) for string and character.. also iconvis mentioned.
An old (2005) unicode library, this may be obsolete
A list of extensions or gems at rubyforge for unicode and unidecode -
@thomthom said:
But that is an IO error. You're trying to create a new file with Unicode characters in the path.
Can a file be created through WIN32ole.so and returned as a Ruby variable and could all writing to the file go through that extension?
-
I have no experiences with .so files.
Advertisement