mysql query to find every occurrence of a non-ascii character in a table column and replace it with its HTML equivalent
I have a column that contains HTML strings and has characters like ® and ™ in开发者_运维问答 it. I want to replace all such characters with their HTML equivalent. Is this possible?
You can do it with multiple nested REPLACE function calls http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace .
REPLACE("nonascii2", "&htmlnonascii2", REPLACE("nonascii1", "&htmlnonascii1", "mystring"))
精彩评论