Own Plugins in 2014
-
hi,
in the last years I built some plugins for my own.
Normally I used Notepad++.Since I have Sketchup 2014, I can't use most of my plugins. If I try to load them an error raises:
Coutdn't load .....rb:
incompatible character encodings UTF-8 and ACSII-8 BIT.I tried some different encodings in Notepad++, nothings worked.
Maybe some of you will give me a helping hint.
Frank
-
The rb files need to be encoded in UTF-8 without BOM.
-
Convert the RB files encoding to 'UTF8-without-BOM'.
Menu option in Notepad++...
Save it afterwards and restart SketchUp...
This encoding works in all versions of Ruby/SketchUp, including Ruby2/v2014.You will need to check that no weird Unicode characters have crept in as a result of the recode, if so replace them and Notepad will use the appropriate coded characters.
Other common errors when migrating to Ruby2 are the way array > string works, and the strict requirement that there is no space between the method and the opening parenthesis around its arguments. Earlier Ruby warned but the newer one just breaks...
So its:
method(arg1, arg2)
NEVER
method (arg1, arg2)
-
@jiminy-billy-bob said:
The rb files need to be encoded in UTF-8 without BOM.
I allways encoded my files as UFT-8 without BOM, for some reason it didn't work in 2014
there is a message: invalid multibyte char (UTF-8)
for every "öäüßÖÄÜ°" (german characters)last week i had the same problem with some other plugins.
i change the encoding to utf-8 and replaced the scrambled characters by hand to the german ones - it worked, but not now.
-
ok, my mistake
i saved some values by write_default, at the start the plugin get them by read_default and in these values i had some non-utf-characters
i changed the values and now it works like before
Frank
Advertisement