Short version:
What escape sequence can I use to search for Unicode characters in mysql command line?
Long version:
I'm looking for a way to search a column for records containing a unicode sequence, U + 200B, in mysql from the command line. I can't figure out which kind of escape to use. I've tried \ u200B and x200B and even I finally found one blog that suggested the _utf8 syntax. This will produce the character on the command line:
select _utf8 x'200B';
Now I'm stuck trying to get this to work in a "LIKE" request.
This generates characters, but% seems to lose its special meaning when placed in the LIKE part:
select _utf8 x'0025200B0025';
I also tried concat, but it didn't work either:
select concat('%', _utf8 x'200B', '%');
Additional information:
I have some data that contains space characters (zwsp), Unicode Point U + 200B in it. This is usually caused by copying / pasting from websites that use zwsp in their release. With most Unicode characters, I can simply insert the character into the terminal (or create it using the key code), but since it is invisible, it is a little more complicated. I can create a file that generates the sequence "%%", and copy / paste it into the terminal, and it will work, but it leaves my command history and output to the hard drive. I would think that there is an easy way to do this in MySQL, but so far I have lagged a bit.
Thanks in advance,
-Paul Burney
source share