Page 1 of 1

persian characters

PostPosted: November 27th, 2007, 4:13 pm
by sepehr
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 ;)
--
thanks in advance

PostPosted: November 28th, 2007, 4:23 am
by Kambiz

PostPosted: November 30th, 2007, 10:37 am
by sepehr
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

PostPosted: November 30th, 2007, 5:07 pm
by Kambiz
After opening the connection, execute:

Code: Select all
SET CHARACTER SET utf8

PostPosted: November 30th, 2007, 5:09 pm
by Kambiz
By the way, be sure to convert SQL commands containing extended characters using UTF8Encode function.