## persian characters

Please discuss general Delphi programming topics here.

### persian characters

hi folks,
i am looking for the easiest way showing persian characters in delphi
var
s:string
begin
s:='مهدي' ;
showmessage(S);
end;
would result ???? , how can i correct that?
i think it's because the default character set for my delphi application is
Ansi and since ansi doesn't have persian characters it can not typecast it correctly and it is converted to ?s , another thing is when i set "Languages for non Unicode Programs" in control panel of windows the problem is solved! and characters are shown properly,but i don't want to make the user do this for running my application,i think i should change the character encoding of my application to unicode ,but how can i do this?

ps:please correct me if i'm wrong with my statments
--

sepehr
Active Member

Posts: 23
Joined: October 4th, 2006, 6:38 am
Location: Karaj

Kambiz

Kambiz

Posts: 2426
Joined: March 7th, 2003, 7:10 pm

thanks,no i have another problem! now the persian characters are stored in mysql database az question marks(?s) what should i do?

ps:my charset in mysql is set to utf8

sepehr
Active Member

Posts: 23
Joined: October 4th, 2006, 6:38 am
Location: Karaj

After opening the connection, execute:

Code: Select all
SET CHARACTER SET utf8
Kambiz

Kambiz

Posts: 2426
Joined: March 7th, 2003, 7:10 pm

By the way, be sure to convert SQL commands containing extended characters using UTF8Encode function.
Kambiz

Kambiz