MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Todd Lyons Date:March 27 2012 6:20pm
Subject:Re: big character constant
View as plain text  
2012/3/27 Halász Sándor <hsv@stripped>:
>>>>> 2012/03/27 00:22 +0200, Walter Tross >>>>
> it looks like it's as simple as this:
> insert into mytable (mycolumn) values (0xE29C94), (0xE29C98)
> In some contexts it might be necessary to force the character set like this, though:
> convert(0xE29C94 using utf8)
> <<<<<<<<
> Yes! and with this I can use it for a constant in the middle of a query, which I
> really want:
> IF(IFNULL(ReceivesFlyer, 1), CONVERT(X'E29C94' USING utf8), '')

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" ?

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. -- Martin Golding
big character constant(Halász Sándor)24 Mar
  • Re: big character constantDavid Turner25 Mar
  • Re: big character constantWalter Tross25 Mar
    • Re: big character constant(Halász Sándor)26 Mar
      • Re: big character constantJohan De Meersman27 Mar
        • Re: big character constant(Halász Sándor)28 Mar
Re: big character constant(Halász Sándor)27 Mar
  • Re: big character constantTodd Lyons27 Mar
    • Re: big character constant(Halász Sándor)28 Mar
      • Re: big character constantNuno Tavares28 Mar
        • Re: big character constantTodd Lyons28 Mar