SerializeJSON doesn't encode UTF8 characters in ColdFusion 9

后端 未结 2 1701
感情败类
感情败类 2020-12-20 16:23

I\'m having some issues with ColdFusion and JSON. My users have filenames and other key words with characters like ç in them which is causing me a pain when I

相关标签:
2条回答
  • 2020-12-20 16:45

    Do the conversion yourself : http://tojson.riaforge.org/ (native) or http://json-lib.sourceforge.net/ (via a Java library)

    0 讨论(0)
  • 2020-12-20 16:48

    You need to specify the Character Set in your CFCONTENT tag. I tried this code in Google Chrome without charset and it returned the text correctly. However, FireFox 3.6 returned the incorrect characters you listed.

    This correctly returns the UTF-8 characters in Chrome, FireFox and MSIE:

    <cfcontent type="application/json; charset=utf-8">
    0 讨论(0)
提交回复
热议问题