Page 1 of 1

How to use persian strings in "Delphi For PHP"

PostPosted: August 3rd, 2007, 3:24 pm
by Sezar
I just realized,delphi for php doesn't support persian strings well.
the persian strings known as non-ascii characters.

PostPosted: August 3rd, 2007, 10:11 pm
by Kambiz
It does.

Use UTF-8 encoding, and don't forget to send encoding to the client.

PostPosted: August 4th, 2007, 2:19 pm
by Sezar
OK! :P

UTF-8 encoding

PostPosted: August 15th, 2007, 5:46 pm
by geowink
And just how do I go about doing the UTF-8 encoding?

Re: UTF-8 encoding

PostPosted: August 15th, 2007, 10:28 pm
by Kambiz
geowink wrote:And just how do I go about doing the UTF-8 encoding?

  1. Save your files as UTF-8
  2. Use meta tag in your HTML files to specify character encoding as follow:
    Code: Select all
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  3. If appropriate, use HTTP header to specify character encoding (see PHP header function).
  4. In your database, set character encoding of string fields to UTF-8
  5. If using MySQL, set transfer encoding of the connection to UTF-8 using the following SQL:
    Code: Select all
    SET NAMES 'utf8';