List:General Discussion« Previous MessageNext Message »
From:Nuno Tavares Date:March 28 2012 8:47am
Subject:Re: big character constant
View as plain text  
Halász, not sure if I understood correcly, but you "mysql" 
console/client may have different charsets. This means you should set it 
accordingly. Check this out:

mysql> show global variables like '%character_set%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
+--------------------------+----------------------------+

Now compare results:

mysql> select convert(0xE29C94 using latin1), convert(0xE29C94 using 
utf8) \G
*************************** 1. row ***************************
convert(0xE29C94 using latin1): ✔
   convert(0xE29C94 using utf8): ?
1 row in set (0.00 sec)

mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> select convert(0xE29C94 using latin1), convert(0xE29C94 using 
utf8) \G
*************************** 1. row ***************************
convert(0xE29C94 using latin1): ✔
   convert(0xE29C94 using utf8): ✔
1 row in set (0.00 sec)



The check mark shows first in the first SELECT, and second on the second 
SELECT. Not sure if you'll be able to see, it's best you try it yourself.


-NT

Em 28-03-2012 03:43, Halász Sándor escreveu:
>>>>> 2012/03/27 11:20 -0700, Todd Lyons>>>>
> This seems backwards from what I expected:
>
> mysql>  select convert(0xE29C94 using latin1), convert(0xE29C94 using utf8) \G
> *************************** 1. row ***************************
> convert(0xE29C94 using latin1): ✔
>    convert(0xE29C94 using utf8): ?
> 1 row in set (0.00 sec)
>
> I expected the second one to print the check mark and the first one to
> have the problem because there is no heavy check mark in latin1.  What
> am I missing, why is it printing out the correct value "using latin1"
> but not "using utf8" ?
> <<<<<<<<
> Correct value? It does not look correct in this message--but maybe you are using a
> display that understands UTF8.
>
> The output of
> convert(0xE29C94 using latin1)
> through the client is three bytes long, sent in order from high to low, and if your
> display does UTF8 the check will show, and the ASCII box drawing, which with "\G" is not
> used, will not line up. Try it after both
> charset latin1
> and
> charset utf8
> .
>
>

Thread
big character constanthsv24 Mar
  • Re: big character constantDavid Turner25 Mar
  • Re: big character constantWalter Tross25 Mar
    • Re: big character constanthsv26 Mar
      • Re: big character constantJohan De Meersman27 Mar
        • Re: big character constanthsv28 Mar
Re: big character constanthsv27 Mar
  • Re: big character constantTodd Lyons27 Mar
    • Re: big character constanthsv28 Mar
      • Re: big character constantNuno Tavares28 Mar
        • Re: big character constantTodd Lyons28 Mar