JSON Special Character conversion

戏子无情 提交于 2019-12-24 15:10:08

问题


I'm trying to insert the returned JSON data from http://cdn.content.easports.com/fifa/fltOnlineAssets/C74DDF38-0B11-49b0-B199-2E2A11D1CC13/2014/fut/items/web/16.json into a table but the LastName field is returned as "LastName":"García Fernández" in a browser but if I save the JSON file and open it in notepad then the LastName is displayed as "LastName":"García Fernández" - which is the way I'd want to insert it into the field.

Anyone know how I can convert these special characters to get them the way they should be?


回答1:


It sounds like a font issue, load a free multilingual or unicode supporting font in the browser within your code.

If that is not the issue because your font is clearly supporting these characters then check the file format in your html, is it UTF-8 for instance? And what browser and version does this happen in? It may be necessary to post some code too.

It seems a bit unlikely that the average font (and font fallbacks) would fail to recognize the characters, for example even OpenSans supports them. If it is simply a font issue, some are listed below.

Free Multilingal Fonts include

  • PT Mono, Sans and Serif
  • Fontface multilingual fonts
  • DejaVu
  • Molengo
  • Create your own font is a custom font generator which you could use too

This can be done in your CSS using these instructions



来源:https://stackoverflow.com/questions/19050624/json-special-character-conversion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!