开发者

Rails & MySQL - Saved HTML Being Truncated at HTML Entity

开发者 https://www.devze.com 2023-01-03 10:39 出处:网络
I\'m saving whole HTML documents in the database with ActiveRecord. I can see in the logs that correct INSERT statements are being generated and sent to MySQL but when I actually look in the database

I'm saving whole HTML documents in the database with ActiveRecord. I can see in the logs that correct INSERT statements are being generated and sent to MySQL but when I actually look in the database after the save has completed, the content is truncated.

It appears that   entities in the document are causing this truncation. I can URL encode the document or 开发者_如何学编程something to avoid this happening but I'd much rather understand why this is happening.


This was an encoding issue - make sure your read the HTML in as UTF8.

0

精彩评论

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