开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜