Hello Kenji, thank you for the hint. I tried something similar before, and I'm afraid your method doesn't help, and actually seems to confirm what I suspected, that LiveCode as it is (I'm using 6.0.0 now) isn't able to handle foreign characters in file names. To be more precise: my impression is that LiveCode in principle is able to handle Unicode (with some effort, see http://lessons.runrev.com/m/4067/l/20441), but the actual programming language (what's its current name?) is not.
To explain what I want: I want the user to choose a folder and then list the folder and its contents, where the names of the files and folders inside might also have foreign characters. Even if I put the correct name into the field (by copy&paste) and set the field's text font to "Unicode", LiveCode cannot recognise it, it seems that the name is immediately translated into the Mac Font if used in the Script. And if I try to use it directly like in put (there is a folder fld Ordner1) then I also get a "false". If I use AppleScript to get the name, as soon as I do something like "put the result into tUTF8Text" the "Ж" in the name of my folder is replaced by a "?" and I found no conversion to bring it back. And I don't see the files and folders functions handling Unicode. I actually tried put "choose folder" & return into asScript put "POSIX path of the result" &return after asScript do asScript as appleScript put the result into tUTF8Text delete char 1 of tUTF8Text delete char -1 of tUTF8Text set the unicodeText fld Ordner1 to uniencode(tUTF8Text,UTF8) but never got anything but a ? for the Ж. Or am I missing a fundamental switch to get this to work? Best Thomas > ------------------------------ > > Message: 26 > Date: Sat, 13 Apr 2013 11:41:06 -0400 > From: "in...@kenjikojima.com" <in...@kenjikojima.com> > To: How to use LiveCode <use-livecode@lists.runrev.com> > Subject: Re: Foreign characters in file names > Message-ID: <0f544eec-a545-458a-8cb3-7d5d2108a...@kenjikojima.com> > Content-Type: text/plain; charset=utf-8 > > Hi Thomas, > If you are on Mac OS, you can use AppleScript. > > This is for two bytes file name of UTF8 text. > > on mouseUp > put "choose file with prompt" "e"e&return into asScript > put "set openFile to result"&return after asScript > put "try"&return after asScript > put "read openFile" & return after asScript > put "on error"&return after asScript > put "close access openFile"&return after asScript > put "display dialog ""e&"Error is occured.""e&return after asScript > put "return"&return after asScript > put "end try"&return after asScript > do asScript as appleScript > put the result into tUTF8Text > delete char 1 of tUTF8Text > delete char -1 of tUTF8Text > set the unicodeText fld 1 to uniencode(tUTF8Text,UTF8) > end mouseUp > > -- > Kenji Kojima / ???? > http://www.kenjikojima.com/ > > > On Apr 13, 2013, at 10:19 AM, Thomas Fischer wrote: > >> Hello, >> >> I have a problem with foreign characters in file names, like Cyrillic or >> Japanese. >> E.g. I didn't find a way to get the correct name of a folder "Bilder ?" >> either using "answer folder?" or dragDrop with dragData. >> Is there a way to handle this situation? >> >> Best regards >> Thomas Fischer >> >> >> >> >> _______________________________________________ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode