PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Logging » Log » Bug #9379

Need a setEncoding method?

Details

Request #9379Need a setEncoding method?
Submitted2006-11-19 06:05 UTC
Frompearbugs2006 at reddreamer dot com
Assignedjon
StatusSuspended
PackageLog
PHP Version5.1.2
OSUbuntu 6.0
Roadmaps(Not assigned)

Comments

[2006-11-19 06:05 UTC] pearbugs2006 at reddreamer dot com

Description:
------------
I'm writing a localized application and using Log with MDB2. I've got my MySQL 5 database tables in UTF-8 and I'm testing with Chinese elsewhere in the application, which gets passed around successfully. When I try to log a message containing Chinese characters, however, the characters get scrambled at some point before they make it to the database.

I'd imagine that you need to add a setEncoding method somewhere, which (for MySQL at least) would run a SET NAMES query. And possibly somewhere there are non-double-byte-safe string handling functions being used?

Lorenzo Alberton has these notes on MDB2 and encoding:

http://www.alberton.info/dbms_charset_settings_explained.html

[2006-12-07 04:55 UTC] pearbugs2006 at reddreamer dot com

I'll see if I can figure out what needs to be changed. For anyone looking at this bug in the future, if you have access to a Windows XP system, to experiment with Chinese and other character sets you can install language support as described in this page:

http://www.microsoft.com/globaldev/handson/user/xpintlsupp.mspx

Windows notepad.exe will support saving a PHP file as UTF-8, as will PHPEclipse, and then you can cut and paste Chinese characters from the Chinese version of Wikipedia or something.