Re: [DB_DataObject] Extended chars come back as ? when selected
| From: | Justin Patrin | Date: | Fri, 02 Jun 2006 04:48:38 +0000 |
| Subject: | Re: [DB_DataObject] Extended chars come back as ? when selected | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24231@lists.php.net to get a copy of this message | ||
On 6/1/06, Josh Santangelo <joshs@endquote.com> wrote:
I have a table that looks like this: CREATE TABLELikely DB_DO (or DB) isn't setting the charset when fetching or is possibly using a single-byte string function on it, thus killing the char. You might try switching to MDB2 as your DB backend, although I don't know if it will fare better. I suggest trying to use MDB2 directly first and see if you can find an option which fixes the problem. If you can't, try the mysqli functions directly and see if they can do it. -- Justin Patrincard([... bunch of fields ...]artvarchar(255) collate utf8_unicode_ci default NULL PRIMARY KEY (cardno) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; A value in the "art" field is often a name that contains an "é" character. It appears fine in phpMyAdmin and other tools, but when using DBDO, I get a "?" symbol outputted to the page: Card: QUERY: SELECT * FROM card ORDER BY cardno Card: query: QUERY DONE IN 0.0053830146789551 seconds Card: find: CHECK autofetchd Card: find: DONE Card: FETCH: a:21:{[...] s:12:"Michel Gagn�";s:8:"extended";s:0:"";} This is the case in both MySQL 4 and 5 using mysqli, using utf8_general_ci or latin1_general_ci. The charset of the web page is utf-8. ...however, now I'm trying the select from the terminal and getting the very same thing back. mysql> select art from card where cardno = 98; +--------------+| art |+--------------+ | Michel Gagn? | +--------------+ 1 row in set (0.00 sec) So clearly this isn't a DBDO problem at all, but um... maybe someone has an answer anyway?