如何阻止 FCKeditor 将 html 实体恢复为其 unicode 字符
我在 FCKeditor 将源视图中输入的 html 实体恢复为其原始 unicode 表示形式时遇到问题。 例如,当我在源视图中输入 €
时,切换到 html,然后返回源视图,该实体将被实际的 € 符号替换。 因此,更大的问题是这个 unicode 字符在提交时被发送回服务器,导致底层数据库表出现字符编码问题。 还有其他人遇到过这个吗? 我尝试了许多配置设置的组合,但都无济于事。
I am having a problem with FCKeditor reverting html entities entered in the source view back to their original unicode representations.
For example when I enter €
into the source view, switch to html and then back to source view, the entity is replaced by an actual € symbol.
The bigger problem, as a result, is that this unicode character is then sent back to the server on submit causing character encoding issues with the underlying database table.
Anyone else come across this?
I have tried many combinations of config settings but all to no avail.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您使用什么版本的 FCKeditor? 当前版本是2.6.3。 我在演示中测试了 € 符号,将
€
复制到源视图中,切换回显示,然后返回 HTML,ASCII€
被正确保留。 因此,听起来您安装的 FCKEditor 可能存在配置问题,或者您需要升级。编辑:刚刚在FCKEditor文档中找到了这个宝石:http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/ProcessNumericEntities
What version of FCKeditor are you using? The current version is 2.6.3. I tested the € symbol in their demo by copying
€
into source view, switched back to display and then back to HTML the ASCII€
was retained correctly. As such it sounds like there might be a configuration problem with your install of FCKEditor or you need to upgrade.Edit: Just found this gem in the FCKEditor documentation: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/ProcessNumericEntities
如果您需要 CKEditor 3 的相同设置,可以使用:
http: //docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.entities
If you need same setting for CKEditor 3, you can use this:
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.entities
问题出在配置设置 -
FCKConfig.ProcessHTMLEntities=true
。尽管我尝试在 fckconfig.js 中更改此设置,但我没有意识到该值在由以前的开发人员创建的辅助自定义配置文件中被覆盖。
谢谢安妮。
The problem was a configuration setting -
FCKConfig.ProcessHTMLEntities=true
.Altough I had tried changing this in fckconfig.js, I did not realise that the value was being over-ridden in a secondary custom configuration file which had been created by a previous developer.
Thanks Anne.