getMudletHomeDir() and encoding

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

getMudletHomeDir() and encoding

Post 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.
Angie @ Midnight Sun 2
Alayla @ God Wars 2

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

Re: getMudletHomeDir() and encoding

Post by Angie »

Should I report this somewhere as a Mudlet bug?
Angie @ Midnight Sun 2
Alayla @ God Wars 2

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: getMudletHomeDir() and encoding

Post 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.

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: getMudletHomeDir() and encoding

Post by Jor'Mox »

Can you show the line of code where you are specifying the path? Maybe it is off in some other way.

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

Re: getMudletHomeDir() and encoding

Post 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.
Angie @ Midnight Sun 2
Alayla @ God Wars 2

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: getMudletHomeDir() and encoding

Post 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.

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

Re: getMudletHomeDir() and encoding

Post 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.
Angie @ Midnight Sun 2
Alayla @ God Wars 2

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

Re: getMudletHomeDir() and encoding

Post 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.
Angie @ Midnight Sun 2
Alayla @ God Wars 2

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: getMudletHomeDir() and encoding

Post 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.

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

Re: getMudletHomeDir() and encoding

Post by Angie »

OK. How would I go about reporting it?
Angie @ Midnight Sun 2
Alayla @ God Wars 2

Post Reply