HTML encoding of Japanese text

I am making a static HTML page that displays courtesy text in several languages. I noticed that if I paste ウェブサイトのメンテナンスの下でin Expression Blend, this text will be the same in the code. I believe this is bad for compatibility and should be replaced with proper HTML objects.

I tried http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/encode.aspx , but it returns me the same Japanese text.

  • Is it correct, from the point of view of browser compatibility, to insert this Japanese language directly into the source code of an HTML page?
  • Otherwise, what is the correct HTML encoding of this text? Or, better, is there any tool I can use to convert non-ASCII characters to HTML objects, possibly on the Internet, and possibly for free?
+5
source share
3 answers

I think this is bad for compatibility and should be replaced with proper HTML objects.

In fact, you prefer not to use html objects, but to correctly declare the document encoding as UTF-8 and use the actual characters . There are many good reasons for this , but the real question is why it does not use it, since it is well and widely supported by the standard?

:

UTF-8 , , .

UTF-8 , HTML , , , .

[] ... .

+2

- UTF-8, http, , - . / encodeURI/decodeURI JavaScript

encodeURI('ウェブサイトのメンテナンスの下で')
//returns"%E3%82%A6%E3%82%A7%E3%83%96%E3%82%B5%E3%82%A4%E3%83%88%E3%81%AE%E3%83%A1%E3%83%B3%E3%83%86%E3%83%8A%E3%83%B3%E3%82%B9%E3%81%AE%E4%B8%8B%E3%81%A7"

decodeURI("%E3%82%A6%E3%82%A7%E3%83%96%E3%82%B5%E3%82%A4%E3%83%88%E3%81%AE%E3%83%A1%E3%83%B3%E3%83%86%E3%83%8A%E3%83%B3%E3%82%B9%E3%81%AE%E4%B8%8B%E3%81%A7")
//returns ウェブサイトのメンテナンスの下で

Unicode, encodeURI/decodeURI - (firebug mozilla/firefox). , !

+1

HTML- , , , . , ASCII , "€". HTML-, ASCII, € .

If you use character encoding for your document, which can represent all the characters you need, such as UTF-8, there is no need for HTML objects. You just need to make sure the browser knows what the document is encoding so that it can interpret it correctly. This is really the preferred method, as it just allows you to read the source code. It doesn't make sense to want to work with HTML objects if you can just work with the actual characters.

See http://kunststube.net/frontback for more information .

0
source

All Articles