Page 1 of 2

getMudletHomeDir() and encoding

Posted: Fri May 09, 2014 3:02 pm
by Angie
I am having problems (yes, again!). This time it is with getMudletHomeDir(). On the Win XP computer at work, the name of the Documents and Settings folder that Mudlet installs its packages to contains Czech characters. Now, Mudlet itself can apparently get to the folder, because it finds the xml. On the other hand, getMudletHomeDir() in my scripts never matches the correct directory and therefore no images are shown. I am not sure what to do about this, since once I am done with the GUI I would like our players to use it and they can be from anywhere in the world and have any sort of weird names.

Re: getMudletHomeDir() and encoding

Posted: Wed May 21, 2014 7:51 pm
by Angie
Should I report this somewhere as a Mudlet bug?

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 12:20 am
by Akaya
I've created UI's for people with directories such as yours with no reported issues. I haven't a way to test it myself. Sorry.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 12:00 pm
by Jor'Mox
Can you show the line of code where you are specifying the path? Maybe it is off in some other way.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 3:25 pm
by Angie
My code is:

Code: Select all

ms_path = string.gsub(getMudletHomeDir().."/MS-GUI","\\","/")
I am having the same problem with the GW2 GUI, which uses:

Code: Select all

gw2_path = getMudletHomeDir().."/GW2_GUI/"
This is what lua display returns:
Image

And this is the real path:
Image

As I said, Mudlet obviously CAN find the directory, because it will load the layout from the xml file, but wherever getMudletHomeDir() is used, the path gets messed up.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 3:45 pm
by Jor'Mox
Well, first, it is important to distinguish between it not being able to display it properly, and it not being stored properly. Have you tried placing a file directly in the profile folder, and using just the string returned by getMudletHomeDir() to access it? You shouldn't need to replace instances of "\" with "/", as it seems to work correctly regardless. I work in Mac OS X, which uses /, but all my code also works in windows, and I use no such replacement, I just make sure that anywhere I am putting a slash in it is always "/".

Anyway, it is possible that what I'm suggesting won't work, because Mudlet may be forcing it into some specific subset of characters, where the one you need isn't allowed. However, I know that the legal characters are certainly more than what the font you are using can display, which is why I don't think the display issue is necessarily indicative of a problem.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 3:55 pm
by Angie
Yes, I first came across the problem because the images for the GUI (which I am pointing to using the code above) would not load.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 3:57 pm
by Angie
I should also note that when I created a separate profile that does not contain special characters (on the same computer), everything works as it should.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 4:05 pm
by Jor'Mox
Then I would think that, yes, you should definitely report it as a bug. Just be sure to include the extra info about it working when special characters aren't present, so you don't get quizzed about the code itself.

Re: getMudletHomeDir() and encoding

Posted: Thu May 22, 2014 10:08 pm
by Angie
OK. How would I go about reporting it?