开发者

mysql query to find every occurrence of a non-ascii character in a table column and replace it with its HTML equivalent

开发者 https://www.devze.com 2022-12-28 13:01 出处:网络
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 wit

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"))
0

精彩评论

暂无评论...
验证码 换一张
取 消