Page 1 of 1

Php Arabic character set encoding

Posted: Sun Jan 15, 2012 6:06 am
by bisharbn
I need to display data from a table (which is arabic data) from sharepoint (sql server 2008) usng php. when i tried this its showing question mark.
I had declared the character set as UTf-8 and also tried iconv to convert the data to utf-8 but the result ??????how can i solve this? :banghead: Any reply is appreciated.Thanks

Re: Php Arabic character set encoding

Posted: Sun Jan 15, 2012 5:44 pm
by Christopher
I assume when you say "declared the character set as UTf-8" that you mean you have set the character encoding for the HTML page to UTF-8. Are you sure that you have done this correctly? Are you sure the data coming from the database is UTF-8?

Re: Php Arabic character set encoding

Posted: Sun Jan 15, 2012 11:07 pm
by bisharbn
Thanks for the reply...yes I declared the html page character set as UTF-8.the data coming from database is UTF-8 ie (MS SQL Server DB).I retrieved the data and the content is arabic which is working fine when retrived in asp pages..where as ????????? question mark on php page.........I want to solve the issue which is in php pages.(question mark ????????) :(

Re: Php Arabic character set encoding

Posted: Wed Jan 18, 2012 8:39 pm
by Eric!
Can you post some code showing us what you are doing? It is possible your database code is not encoding the strings properly. Or it could be that PHP is confused with the multibyte strings for UTF-8 and you need to use multibyte safe methods.

Re: Php Arabic character set encoding

Posted: Thu Jan 19, 2012 12:57 pm
by bisharbn
Thanks for the reply...i'm fetching data from sharepoint server directly(sql server 2008) the data is arabic its saving direclty from sharepoint server...so i dont know what type of encoding is sharepoint using in saving the data ...
I didnt understand about mulitbyte string of UTF-8 ..can u pls explain or show an example..

Re: Php Arabic character set encoding

Posted: Thu Jan 19, 2012 3:07 pm
by Vegan
looks like the database may not be configured correctly

Re: Php Arabic character set encoding

Posted: Sun Jan 22, 2012 12:15 am
by bisharbn
Vegan wrote:looks like the database may not be configured correctly
But the same db is working fine in asp.net page ie the arabic is displaying...the question mark is shown only in php page...So it cant be concluded as the DB problem..

Re: Php Arabic character set encoding

Posted: Mon Jan 23, 2012 8:37 am
by Eric!
The database connection might not be the correct encoding. Take a look at this thread for ideas
viewtopic.php?f=2&t=132655

If it's not the database encoding or connection type, then look at php multibyte functions. Take a look at this page for help
http://developer.loftdigital.com/blog/p ... cheatsheet