On Fri, 2012-02-17 at 08:38 -0500, Daniel Convissor wrote:
> > A related problem was found by the test script.  libmysql is completely
> > ignoring the character set information in my.cnf.  Plus, if one forces a
> > character set by calling options(SET NAMES utf8) before connecting,
> > character_set_name() still returns unexpected information.
> > 
> > Can you please take a look at this test script:
> > http://www.analysisandsolutions.com/php/libmysql.ignoring.character.set.php
> 
> Can one of you please examine why libmysql is not acting as documented
> and reply here in the near future?

In my tests it worked like I expect:
- the initial charset is the one configured
- changing the charset affects the behavior

Mind two things:

1) You said

 * /etc/my.cnf settings are (no other my.cnf files exist):
 * + default-character-set = utf8
 * + character-set-server = utf8

In which section of the my.cnf file? Both for the server, or for the
client?

2) SET NAMES changes the setting on the server. The client won't know
about this and still assume the old charset was used. Use
mysqli_set_charset().

In summary: charsets and encoding are a mess, especially if you have
many places to configure those. One small oversight and all is messed.

As reference:
http://dev.mysql.com/doc/refman/5.5/en/charset-configuration.html

johannes

> Thanks,
> 
> --Dan
> 
> -- 
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>             data intensive web and database programming
>                 http://www.AnalysisAndSolutions.com/
>  4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409
> 



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to