简体   繁体   中英

Remove invisible backspace characters from mysql data

I have the following invisible character in my dataset

在此处输入图片说明

Which I believe is this character

http://www.fileformat.info/info/unicode/char/0008/index.htm

How do I remove this? I've tried

UPDATE events SET `value` = TRIM(REPLACE(`value`, CONVERT(char(8) USING hp8), ''))

MySQL escape sequence for literal backspace character is \\b .

See "Special Character Escape Sequences" here:

http://dev.mysql.com/doc/refman/5.7/en/string-literals.html


If I needed to remove that character from a string column, I'd use an expression like this:

 REPLACE(foo,'\b','')

I'd test that expression in a SELECT statement before I tried an UPDATE, eg

SELECT t.foo
     , REPLACE(t.foo,'\b','')` AS new_foo
  FROM mytable t
 WHERE t.foo LIKE '%\b%'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM