Skip to content
Advertisement

Using REPLACE with CHAR(160) is Returning Hexadecimal as Value

I am trying to get rid of &nbsp characters in MYSQL, but am getting weird behavior where using REPLACE is returning a hexadecimal string.

The original value is some HTML stored in a field with the type BLOB:

The SQL I am using is this:

And after executing, this is what is left in the database:

What is going on and how could I avoid this? Do I need to use VARCHAR for the field type?

Advertisement

Answer

I found that CHAR codes didn’t work, but a copy pasted whitespace worked. This looks like a normal space, but is in fact CHAR(160) and I don’t have an error anymore. ' '

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement