How to get Korean language characters to display on a website?

我只是一个虾纸丫 提交于 2020-01-15 12:12:30

问题


We have a website that will be displayed in various languages. Our footer gives the option to view the Korean site.

    <ul>
      <li><a href="index.aspx">English</a></li>
      <li><a href="de/index.aspx">Deutsch</a></li>
      <li><a href="nl/index.aspx">Nederlands</a></li>
      <li><a href="kr/index.aspx">한국의</a></li>
    </ul>

As I developed this locally, everything showed up well.

But when I launched it to our testing server which is in a .net environment, it did not display well.

When I did a search for finding solutions I found a site which covered some basics about displaying Korean http://www.katpatuka.org/pub/doc/content-language/ko.htm

They suggested adding the following <meta> tags

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=KS_C_5601">
    <META HTTP-EQUIV="Content-language" CONTENT="ko">

Which I tried but to no avail. What can resolve this?


回答1:


The sample page mentioned is sent by the server with the HTTP header

Content-Type: text/html; charset=iso-8859-9

This must be all wrong. ISO-8859-9 is an 8-bit code, known as Latin/Turkish or ISO Latin5.

A meta tag cannot override the encoding information in HTTP headers. You need to fix the server configuration.

The page seems to display OK if I manually (using browser settings, overriding HTTP headers) set the encoding to “Korean” in Chrome, whatever that might mean (windows-949, perhaps). Ditto on IE 10. In Firefox, there are three Korean encodings selectable. The one that makes the page display OK is “EUC-KR”. The differences between it and windows-949 might (or might not) be insignificant here.

So it’s rather confusing. I would really suggest converting the encoding to UTF-8 and declaring it in HTTP headers. (Actually, it suffices to use “UTF-8 with BOM”, since browsers will infer UTF-8 from the BOM, overriding any other information.)



来源:https://stackoverflow.com/questions/16945681/how-to-get-korean-language-characters-to-display-on-a-website

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