How to read filenames based on greek charcters

Community forum for discussions completely unrelated to MediaMonkey.

Moderator: Gurus

larshgf

How to read filenames based on greek charcters

Post by larshgf » Wed Oct 19, 2005 5:02 pm

Hi,

Maybe this might be a question for one of the programmers in MediaMonkey: I'm using Delphi 5. In order to programmtically change the local language my PC is using I have looked on the function SetThreadLocale, and after surfing the web I was recommended to start my application in this way in order to obtain the greek language:

program Mp3_TagEdit_Prj;

uses
Forms,
Windows, **
SysUtils, **
MainUnit in 'MainUnit.pas' {MainForm};

{$R *.RES}

begin
SetThreadLocale($0408); **
GetFormatSettings; **
Application.Initialize; **

Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

(the programlines with ** is added to my standard programstart)

But the problem is that this does not functionate. When I try to show the content of a folder in FileListBox everything works fine as long as the filename is made up of english characters, but if the folder contains filenames mad up of greek characters I get an I/O error 123 men which means that the file cannot be opened - in another way FileListBox is not able to read these greek filenames.

In my program all fonts are set to GREEK_CHARSET.

But I still program in Delphi 5, and I wonder if I would get rid of this problemg by using the newest Delphi 2005 instead ??

I think it is peculiar that my Windows XP can read greek filenames without problems. Likewise my mp3-program
(MediaMonkey) can read these files too without any problems

[the following "labels" from windows XP is my own translation to english from the danish version and is probably not exactly right]
If I go in Windows XP "Control Panel" and open "International and language settings", and then under the tab "Advanced" under "Language with non-unicode programs" set the language to Greek and RESTART my PC
- then my FileListBox can read the greek filenames.
But as mentioned earlier - I would like to be able to do this programmatically, and not by change a setting in Windows and restart my PC.

So finally my question is:
Do you think thar using Delphi 2005 instead of Delphi 5 will solve the problem?? Or could there be any other solutions/suggestions to solve the problem??

Hoping very much for an answer

KindRegards
Lars

Peke
Posts: 11449
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Post by Peke » Wed Oct 19, 2005 5:16 pm

MM is using either Delphi UTF8 Functions or TNT Unicode Controls which can be found on
http://home.ccci.org/wolbrink/tntmpd/de ... roject.htm

I hope this help you.

Addon:
Have you changed Charset in ListBox to Greek?
You will also find nice tool to migrate from clasic Delphi to unicode at
http://www.tntware.com/delphicontrols/u ... nloads.htm
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add Images to forum

larshgf
Posts: 44
Joined: Fri Oct 21, 2005 1:42 am

Post by larshgf » Fri Oct 21, 2005 1:47 am

Thanks Peke,

Undortunately your first link does not work ("page can not be found").
I have tried the TNTWare on the second link and it looks promising. I just have to get it right in my program. If I do not succeed I might ask a question more if that's OK?

Best Regards
Lars

Peke
Posts: 11449
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Post by Peke » Fri Oct 21, 2005 6:27 pm

Ok Sorry for first link it was redirect from other site :(
The right one was:
http://www.tntware.com/delphicontrols/unicode/

There should be no problems in Changing to Unicode and if you have ask.
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add Images to forum

Post Reply