开发者

Using JQUERY Load, it's display "isnu2019t" instead of "isn't" which is in the DB. y?

Anyone have any ideas why a JQUERY L开发者_运维百科OAD Call which has "isn't" in the db is displaying as isnu2019t using JQUERY load?


Have you html encoded the return string from the server?


Code point 0x2019 in Unicode is "Right Single Quotation Mark", which is the preferred Unicode character for apostrophe. My guess is that your DB is storing (and displaying in whatever you're using to look at it) unicode, and something in the path from your DB to jQuery (or jQuery itself) is turning that into u2019. Are you converting to latin-1 anywhere, or otherwise throwing away unicode data in some kind of string conversion?


This sounds like a character encoding problem. 0x2019 is the UTF-8 encoding for a "smart quote" (almost always something pasted from a Microsoft editor). Ensure that every step of the transaction understands what encoding is really in use.

  1. What is the character set used for that column in MySQL?
  2. What character set are you using in the SET NAMES query to MySQL at the beginning of the request? (Related thing to check: make sure you're even doing a SET NAMES)
  3. What character set are you declaring the response to be in when replying to the AJAX request?
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜