sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Incompatible character encodings loading .so files

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 4 Posters 688 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Al HartA Offline
      Al Hart
      last edited by

      We have a user running on Windows XP in Czechoslovakia.

      When he tries to load our .so file with require he gets the error:

      Error: #<Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8>

      After some looking around we discovered that his plugins folder is in:

      C:/Documents and Settings/Owner/Data aplikací/SketchUp/SketchUp 2014/SketchUp/Plugins

      The last character of the phrase: "Data aplikací" is a Unicode character, and we have verified that this character is what is causing the problem. ("Data aplikací" is not his user name, but rather the path Windows uses in XP for the plugins folder)

      Has anyone else run into a similar problem with Unicode characters in the plugins path, and (hopefully) found a solution?

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

      1 Reply Last reply Reply Quote 0
      • S Offline
        slbaumgartner
        last edited by

        This problem has been popping up all over and there are several other topics about it. Thom Thom in particular is trying to find a solid solution.

        1 Reply Last reply Reply Quote 0
        • Al HartA Offline
          Al Hart
          last edited by

          This particular problem went away when the user switched to Windows 7 from XP.

          However, we have the same problem when a user has a unicode character in his name.

          Sometimes we can get a user to change his/her user name. But this was a word from the Windows operation system which is probably harder to change.

          Hopefully Thom Thom can think of something.

          Al Hart

          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
          IRender nXt from Render Plus

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            In this very week we suddenly got an array of these issues reported. :s
            We're investigating. Please follow my thread at: http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=57017

            There are several issues at play here. I'll come back with a better overview once we've gotten the full picture.

            1 Reply Last reply Reply Quote 0
            • Al HartA Offline
              Al Hart
              last edited by

              Thanks TT. I knew, (or at least really hoped), that you would be on top of this.

              We will try some of the ideas in the other thread and see if that helps.

              Al Hart

              http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
              IRender nXt from Render Plus

              1 Reply Last reply Reply Quote 0
              • tt_suT Offline
                tt_su
                last edited by

                So far I've found one workaround, that require a call to the Win32 API GetShortPahName function - take the folder part of the SO filename and convert it to DOS 8.3 style filename - then Ruby will load because it appear that Ruby is still calling the ASCII version of Windows' file functions in some cases.
                Note, you must leave the actual name of the SO alone - only the folder path can be trunkated with GetShortPahName.

                1 Reply Last reply Reply Quote 0
                • Al HartA Offline
                  Al Hart
                  last edited by

                  Is GetShortPathName in ruby or in Win32API.so?

                  If it is in Win32API.so, is there a version of that anywhere we can use?

                  And where would we put it - since it is the Plugins Folder we cannot load things from.

                  I presume I could load Win32API.so from the Plugin folder if I did not need to give it a path name.

                  Al Hart

                  http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                  IRender nXt from Render Plus

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    AL.. "Win32API.so" is replaced in Ruby 2.0 with a pure ruby wrapper script named "Win32API.rb" (It wraps old style Win32API calls into calls to the DL library.)

                    So this wrapper script is included within SketchUp 2014's "RubyStdLib" folder.

                    You simply call:
                    require("Win32API") unless defined?(Win32API)

                    .. or you can require("dl")
                    and make DL style calls.

                    Do not copy old "Win32API.so" files from 1.8 Ruby into the "Plugins" folder for SketchUp v14 or higher !

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • Dan RathbunD Offline
                      Dan Rathbun
                      last edited by

                      @al hart said:

                      Is GetShortPathName in ruby or in Win32API.so?

                      Neither.

                      It is in "Kernel32.dll", and you use either Win32API or DL class objects to wrap calls into that native library.

                      See: [MSDN : GetShortPathName()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa364989(v)

                      Ruby : DL library

                      .. and since DL ( really is deprecated, and now a wrapper into Fiddle calls,):
                      Ruby : Fiddle library

                      💭

                      I'm not here much anymore.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement