如何阻止 FCKeditor 将 html 实体恢复为其 unicode 字符

发布于 2024-07-07 14:50:50 字数 227 浏览 5 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

琉璃梦幻 2024-07-14 14:50:50

您使用什么版本的 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

你在我安 2024-07-14 14:50:50

如果您需要 CKEditor 3 的相同设置,可以使用:

config.entities = false;

http: //docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.entities

If you need same setting for CKEditor 3, you can use this:

config.entities = false;

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.entities

醉城メ夜风 2024-07-14 14:50:50

问题出在配置设置 - 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文