Problem of Connection Character Sets and Collations

Problem of Connection Character Sets and Collations

am 06.09.2008 16:41:26 von EdwardSPL

Dear All,

For displaying with unicode Character Sets problem :

MySQL :
Command line of mysqldump and mysql :
Which command line is right ?
1, --default-character-set=utf8
2, --default-character-set=utf-8

phpmyadmin :
The Connection Character Sets and Collations setting :
Which command line is right ?
1, utf8_bin
2, utf8_general_ci
3, utf8_unicode_ci

php :
Which command line is right ?
1, mysql_query("SET NAMES utf8");
2, mysql_query("SET NAMES utf-8");

Many thank for your help !

Edward.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Problem of Connection Character Sets and Collations

am 08.09.2008 16:54:01 von tmboyd1

> -----Original Message-----
> From: edwardspl@ita.org.mo [mailto:edwardspl@ita.org.mo]
> Sent: Saturday, September 06, 2008 9:41 AM
> To: mysql@lists.mysql.com
> Cc: php
> Subject: [PHP] Problem of Connection Character Sets and Collations
>=20
> Dear All,
>=20
> For displaying with unicode Character Sets problem :
>=20
> MySQL :
> Command line of mysqldump and mysql :
> Which command line is right ?
> 1, --default-character-set=3Dutf8
> 2, --default-character-set=3Dutf-8

MySQL question. There's got to be a mailing list on http://www.mysql.com
..
=20
> phpmyadmin :
> The Connection Character Sets and Collations setting :
> Which command line is right ?
> 1, utf8_bin
> 2, utf8_general_ci
> 3, utf8_unicode_ci

PHPMyAdmin question. PHPMyAdmin, while written in PHP, is not PHP. This
would be like asking Internet Explorer questions in a Visual C/C++
mailing list/forum.
=20
> php :
> Which command line is right ?
> 1, mysql_query("SET NAMES utf8");
> 2, mysql_query("SET NAMES utf-8");

Again, a MySQL question. I have to admit, though--you were tricky with
this one. Wrapping your SQL code in a PHP function and posing it as a
PHP question was awful slick. This question by itself is, I suppose,
fairly relevant to PHP (in spite of its underlying MySQL subject
matter)... but the other two are just bizarre and wholly unrelated, to
be honest.

Just to show I'm not an entirely negative person, I did some searching.
After a Google session that lasted all of about a minute and a half, I
found this page:
http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html which shows
"utf8" being used in a MySQL command. My guess is that answer #1 and
answer #3 are "utf8" instead of "utf-8".


Todd Boyd
Web Programmer



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Problem of Connection Character Sets and Collations

am 08.09.2008 17:35:22 von EdwardSPL

--------------080901070804080206050907
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Boyd, Todd M. wrote:

>>-----Original Message-----
>>From: edwardspl@ita.org.mo [mailto:edwardspl@ita.org.mo]
>>Sent: Saturday, September 06, 2008 9:41 AM
>>To: mysql@lists.mysql.com
>>Cc: php
>>Subject: [PHP] Problem of Connection Character Sets and Collations
>>
>>Dear All,
>>
>>For displaying with unicode Character Sets problem :
>>
>>MySQL :
>>Command line of mysqldump and mysql :
>>Which command line is right ?
>>1, --default-character-set=utf8
>>2, --default-character-set=utf-8
>>
>>
>
>MySQL question. There's got to be a mailing list on http://www.mysql.com
>.
>
>
>
>>phpmyadmin :
>>The Connection Character Sets and Collations setting :
>>Which command line is right ?
>>1, utf8_bin
>>2, utf8_general_ci
>>3, utf8_unicode_ci
>>
>>
>
>PHPMyAdmin question. PHPMyAdmin, while written in PHP, is not PHP. This
>would be like asking Internet Explorer questions in a Visual C/C++
>mailing list/forum.
>
>
>
>>php :
>>Which command line is right ?
>>1, mysql_query("SET NAMES 'utf8'");
>>2, mysql_query("SET NAMES utf-8");
>>
>>
>
>Again, a MySQL question. I have to admit, though--you were tricky with
>this one. Wrapping your SQL code in a PHP function and posing it as a
>PHP question was awful slick. This question by itself is, I suppose,
>fairly relevant to PHP (in spite of its underlying MySQL subject
>matter)... but the other two are just bizarre and wholly unrelated, to
>be honest.
>
>Just to show I'm not an entirely negative person, I did some searching.
>After a Google session that lasted all of about a minute and a half, I
>found this page:
>http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html which shows
>"utf8" being used in a MySQL command. My guess is that answer #1 and
>answer #3 are "utf8" instead of "utf-8".
>
>
>Todd Boyd
>Web Programmer
>
>
Hello Todd,

So, do you means as the following (If we need define the unicode
character sets )?

For php connection with MySQL :
mysql_query("SET NAMES 'utf8'");

For running MySQL command line ( such as mysqldump and mysql ) :
--default-character-set=utf8

For using phpmyadmin ( Choose Connection Character Sets and Collations
setting ) :
use utf8_general_ci ( NOT use utf8_unicode_ci )
What different between them ?

Are these setting right ?

Thanks for your help !

Edward.

--------------080901070804080206050907--

Re: Problem of Connection Character Sets and Collations

am 08.09.2008 17:35:22 von EdwardSPL

--------------080901070804080206050907
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Boyd, Todd M. wrote:

>>-----Original Message-----
>>From: edwardspl@ita.org.mo [mailto:edwardspl@ita.org.mo]
>>Sent: Saturday, September 06, 2008 9:41 AM
>>To: mysql@lists.mysql.com
>>Cc: php
>>Subject: [PHP] Problem of Connection Character Sets and Collations
>>
>>Dear All,
>>
>>For displaying with unicode Character Sets problem :
>>
>>MySQL :
>>Command line of mysqldump and mysql :
>>Which command line is right ?
>>1, --default-character-set=utf8
>>2, --default-character-set=utf-8
>>
>>
>
>MySQL question. There's got to be a mailing list on http://www.mysql.com
>.
>
>
>
>>phpmyadmin :
>>The Connection Character Sets and Collations setting :
>>Which command line is right ?
>>1, utf8_bin
>>2, utf8_general_ci
>>3, utf8_unicode_ci
>>
>>
>
>PHPMyAdmin question. PHPMyAdmin, while written in PHP, is not PHP. This
>would be like asking Internet Explorer questions in a Visual C/C++
>mailing list/forum.
>
>
>
>>php :
>>Which command line is right ?
>>1, mysql_query("SET NAMES 'utf8'");
>>2, mysql_query("SET NAMES utf-8");
>>
>>
>
>Again, a MySQL question. I have to admit, though--you were tricky with
>this one. Wrapping your SQL code in a PHP function and posing it as a
>PHP question was awful slick. This question by itself is, I suppose,
>fairly relevant to PHP (in spite of its underlying MySQL subject
>matter)... but the other two are just bizarre and wholly unrelated, to
>be honest.
>
>Just to show I'm not an entirely negative person, I did some searching.
>After a Google session that lasted all of about a minute and a half, I
>found this page:
>http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html which shows
>"utf8" being used in a MySQL command. My guess is that answer #1 and
>answer #3 are "utf8" instead of "utf-8".
>
>
>Todd Boyd
>Web Programmer
>
>
Hello Todd,

So, do you means as the following (If we need define the unicode
character sets )?

For php connection with MySQL :
mysql_query("SET NAMES 'utf8'");

For running MySQL command line ( such as mysqldump and mysql ) :
--default-character-set=utf8

For using phpmyadmin ( Choose Connection Character Sets and Collations
setting ) :
use utf8_general_ci ( NOT use utf8_unicode_ci )
What different between them ?

Are these setting right ?

Thanks for your help !

Edward.

--------------080901070804080206050907--

Re: Problem of Connection Character Sets and Collations

am 09.09.2008 15:15:12 von Eric Butera

On Sat, Sep 6, 2008 at 10:41 AM, wrote:
> php :
> Which command line is right ?
> 1, mysql_query("SET NAMES utf8");
> 2, mysql_query("SET NAMES utf-8");
>
> Many thank for your help !
>
> Edward.

On the php side look at this:

http://us3.php.net/manual/en/function.mysql-set-charset.php

That's recommended over set names.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re[2]: Problem of Connection Character Sets and Collations

am 10.09.2008 01:25:54 von AnrDaemon

Greetings, edwardspl@ita.org.mo.
In reply to Your message dated Monday, September 8, 2008, 19:35:22,

>>>For displaying with unicode Character Sets problem :
>>>
>>>MySQL :
>>
>>MySQL question. There's got to be a mailing list on http://www.mysql.com

>>>phpmyadmin :
>>
>>PHPMyAdmin question. PHPMyAdmin, while written in PHP, is not PHP. This
>>would be like asking Internet Explorer questions in a Visual C/C++
>>mailing list/forum.

> So, do you means as the following (If we need define the unicode
> character sets )?

No, he means, that you must do your homework yourself. (That is, must as
opposite to should)
And he told you where to go to get the info you need.
From your first post, it is clearly looks like skill-checking test of some
sort. And if it is, you must read and understand documentation about mentioned
things.
I've left required info in quotation. Read it again, if you didn't understand
it first time.


--
Sincerely Yours, ANR Daemon


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php