37099

Chinese text not displaying properly on web page

Question:

I am adding some Chinese text to a primarily English web page and am having trouble getting the characters to display properly. I've got the encoding set to UTF-8 in the meta content type tag, and I am copying/pasting the Chinese I was sent from a Word document. The text is still rendering as follows:

繁體中文版

rather than in Chinese characters:

繁體中文版

I'm sure it's an easy fix, but I'm lost as to how to make this happen.

Thanks very much for any help.

Answer1:

just because the meta tag says that the encoding is UTF8, doesn't mean that the content (file) itself is in UTF8. I mean, if you have a file index.html, the file itself should be encoded as utf8.

To change the encoding of a file in lunix, you can use this command

iconv --from-code=ISO-8859-1 --to-code=UTF-8 ./index.html > ./newIndex.html

but i guess that you are working with windows... and the only way i know change the encoding in windows is the Notepad++

Hope this helps

Recommend

  • javafx 3d performance large data set
  • Add spaces between words in spaceless string
  • jinja2 template not found and internal server error
  • Rails 5 - Google Maps - Javascript error - initMap is not a function - fixing one js issue creates a
  • How secure are apple APNS push notifications?
  • How to use animated gif in Firemonkey?
  • matching similar elements in between two lists
  • Why does the font in these TD elements render at different sizes?
  • How to render a pixel array most efficiently to a window in c++?
  • How to use Windows Media Foundation with UWP without a topology
  • jQuery: How to AJAXify WordPress Search?
  • Mysql - How to search for 26 records that each begins with the letter of the alphabet?
  • JBoss External Properties Files in Classpath
  • Android - Material Design - NavigationView - How to put vertical scroll?
  • Declaring variable dynamically in VB.net
  • How do I get HTML corresponding to current DOM tree?
  • JQuery Internet Explorer and ajaxstop
  • JSON response opens as a file, but I can't access it with JavaScript
  • Jquery UI tool tip close icon
  • Get one-time binding to work for ng-if
  • Display issues when we change from one jquery mobile page to another in firefox
  • Volley JsonObjectRequest send headers in GET Request
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • SSO with signing and signature validation doesn't work
  • Join two tables and save into third-sql
  • Change an a tag attribute in JavaScript based on screen width
  • Importing jscolor library in angular 2
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Free memory of cv::Mat loaded using FileStorage API
  • How to set the response of a form post action to a iframe source?
  • How do I configure my settings file to work with unit tests?
  • Change div Background jquery
  • Qt: Run a script BEFORE make
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • reshape alternating columns in less time and using less memory
  • costura.fody for a dll that references another dll
  • Binding checkboxes to object values in AngularJs