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

    [Code] UnicodeEx - (0.2.0a) Sketchup + Character Encoding

    Scheduled Pinned Locked Moved Developers' Forum
    24 Posts 5 Posters 7.6k Views 5 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.
    • thomthomT Offline
      thomthom
      last edited by

      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.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

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

        @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

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • T Offline
          tomasz
          last edited by

          @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?

          Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            I have no experiences with .so files. 😕

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

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

            Advertisement