Understand what encoding SketchUp 8?
-
SketchUp 5
path = "C:\Users\Admin\Documents\ΠΌΠΎΡ ΠΌΠΎΠ΄Π΅Π»Ρ.skp"
encode_to_utf-8 path
model.save path -> works
Sketchup.open_file path -> worksSketchUp 8
path = "C:\Users\Admin\Documents\ΠΌΠΎΡ ΠΌΠΎΠ΄Π΅Π»Ρ.skp"
encode_to_utf-8 path
model.save path -> does not work
Sketchup.open_file path -> worksWhat encoding supports Sketchup 8 to save the model?
-
Maybe
path = "C:\Users\Admin\Documents\ΠΌΠΎΡ\ ΠΌΠΎΠ΄Π΅Π»Ρ.skp"
or 'C:\Users\Admin\Documents\ΠΌΠΎΡ ΠΌΠΎΠ΄Π΅Π»Ρ.skp' -
Maybe / ?
-
Problem in "Cyrillic"
"Cyrillic" in utf-8
Sketchup 5 and reads and stores
Skutchup 6 7 8 only reads but does not save.
Skutchup 6 7 8 reads "Cyrillic" in utf-8
And when you save what encoding uses (cp1252 cp866??????)
-
I wrote about SketchUp and Unicode a while back: http://sketchucation.com/forums/viewtopic.php?t=20657
Summary:
Ruby 1.8 does not understand Unicode strings - it treat each byte as a character.
Ruby 1.8 under Windows cannot read/write, handle files with multi-byte characters. Needs to be ASCII characters. This is because Ruby calls the A (ASCII) versions of the file system function instead of the W (Wide characters - unicode) versions.
Ruby 1.8 under OSX is able to open unicode files. -
Oh - you're using the open and save model functions of the API. Ah - now that is interesting. I'd expect, at least the recent version to use UTF-8.
-
I wrote this script to
Perhaps what is in it and is not correct.
But Ruby is well aware of it, let'sstring = File.join (File.dirname (FILE), "ΠΠΎΡ ΠΏΠ°ΠΏΠΊΠ°"))
string = encode_to_cp1251 (string)
Dir.mkdir (string) -> works fine
And as Sketchup 5 works great
A Sketchup 6 7 8 only read but can not green triangle icon
Encodes from cp1251 to utf-8
And a coding of utf-8 cp1251 (Cyrillic)In SketchUp 5 everything works fine
Advertisement