如何将字符串中的 \xA0 (或非 ASCII)字符替换为 ' '?
我有一个 Excel 文件,其中包含许多非 ASCII 字符,我想用空格字符替换它们。
该文本将被输入到 MySQL 数据库中,并且不会与字符串中的这些字符一起导入。尝试发布该行时,我收到 HY000 错误的字符串值
。
I have an excel file with numerous Non-ASCII characters which I would like to replace with the space character.
This text is to be entered into a MySQL database, and it will not import with these characters in the strings. I get a HY000 Incorrect string value
when trying to post the row.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果非 Ascii 字符集是固定的,您可以使用:
其中 #1#4 是您要替换的非 Ascii 字符。
这里是一些有关其使用的文档。
您也可以这样做。
然后可以将CharInSet中的Set更改为可接受的字符。
If the set of Non-Ascii characters is fixed you could use:
where #1#4 is the non-ascii characters you want to have replaced.
Here is some docs on it's use.
You could also do this.
Then you can change Set in CharInSet to the acceptable characters.