[Code] file_found?(path) and to_ascii+to_unicode.rb
-
I am glad you have taken such a complicated thing over ....
-
@tig said:
I am glad you have taken such a complicated thing over ....
I'm not... This makes my head hurt.
But I need to know.But at least it beats sudoko puzzles...
-
-
-
-
I am looking into this issue right now. I haven't found anything more then TIG and Thomas has figured out. I have even started to code a C extension to return proper string converted from Ruby UTF-8, but my poor C knowledge doesn't let me progress fast.
As far as I understand Win uses UTF-16 format, but the whole encoding thing hurts my head badly.
Have someone made any progress on this issue? -
What are you trying to do? String conversion? Or deal with files with unicode characters?
-
@thomthom said:
What are you trying to do? String conversion? Or deal with files with unicode characters?
I am trying to create a file with a path/filename containing for example Polish characters 'BΕΔ d.xml'. They are not part of ISO 8859-1 so the
.pack('C*')
doesn't generate proper path and file will be created under different name 'BΔΉβΓβ¦d.xml' -
Right, what you want to do is make your C extension call the Unicode version of the file API's - as converting from Unicode to ASCII in order to try and make Ruby's file functions work will in most cases not work.
Note that the ASCII limitation for SketchUp's Ruby file functions exist only under Windows. Under OSX they should work AFAIK.
-
Do not ignore Dan Berger's windows-pr package. It goes along with his win32-api package. Has the Windows "unicode.rb"
In windows-apt-0.4.0 there's a complementary file "wide_string.rb"
Advertisement