Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Weird path problem & Ruby...

I've been stumped on this problem for days and I have a feeling that it
is really simple...

I am trying to create a folder at the following location:
C:\documents and settings\[username]\application data\amaranth

The following code works great unless the username has a non-English
character in it (for example, Joe (with accent over the e)). In this case, when I try to use the
path, I get a "path not found" error, and it says that the path is:
C:\documents and settings\Jo\application data\amaranth

From what I can see, my code is striping out any non-English characters.
I'm not quite sure how to get these non-English characters to show up.

Here is my code:

Code:
  path = " " * 256
  path = ENV['APPDATA'].rstrip 
  $appPath = path + "\\Game"

Does anyone have any idea what I'm doing wrong?
 

khmp

Sponsor

Hmm I thought strings in Ruby were utf8 which should handle Multilingual characters. Did you try string.toutf16 instead of string.rstring? By the way why do you have string.rstring in there? Other than that I have no idea why it was cut out. Sorry I couldn't be of much help :s
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top