Re: utf8_encode arabic text

From: Date: Fri, 11 Apr 2003 23:10:37 +0000
Subject: Re: utf8_encode arabic text
References: 1  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-534@lists.php.net to get a copy of this message
Hi, First, utf8_encode() / utf8_decode() are only capable of converting iso-8859-1 to utf-8 and vice versa. In this case, use iconv extension instead, while mbstring extension cannot handle Arabic texts either. Secondly, the default_charset directive doesn't have any effect on actual outputs. It just tries to set Content-Type header to the given value. Moriyoshi "Nathalie Boulos" <nathalieboulos@hotmail.com> wrote: > Hello all, > > I'm using PHP-4.2.2 to access a unicode postgresql database through a web > interface on a RedHat Linux server. > I'm using arabic and french characters in the DB. > > In the php.ini file, i have sp辿cified the default charset to: > > default_charset = "utf-8" > > I need to import and export CSV files in and out of the unicode database. > CSV are edited in MS Excel on a windows 2000. The script that does the > import/export is written in PHP and the end user can access the program > through HTML web page. > > I'm using utf8_encode() and utf8_decode() functions to encode/decode strings > read from the CSV file before/after appending/querying the database. > > The french characters are correctly read in an HTML interface, and in a CSV > file generated from the database (opened in excel). > > My problem is with the arab text. > 1.When i insert a CSV file with arab text after utf8_encoding in the > database, i cannot view properly the inserted record on my web interface. > > 2. when i append the database using PHP via an HTML form with arabic test, > and i try to import a CSV file of the appended table to Excel, the arabic > words are marked with ????? > But the display of the inserted record in the browser is OK. > > So, i don't know why I'm facing this problem converting arabic characters > from ISO-8859-6 (I guess it's the encoding used by Excel) to UTF-8 > > I would greatly appreciate any suggestion and thank you in advance. > > Best regards > > Nathalie > > > _________________________________________________________________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > -- > PHP Internationalization Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.i18n (#534) next »