Results 1 to 6 of 6

Thread: What is the tag to allow Japanese to be displayed via UTF?

  1. #1
    Join Date
    Mar 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default What is the tag to allow Japanese to be displayed via UTF?

    I know there is some head tag to add to allow pages to display Japanese text but I'm not sure what it is as times have changed. Could someone please lead me in the right direction? Hopefully I'm asking the question right.. I remember using something with the term 'UTF-8' in it. Sorry I cannot provide more information.

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bubbletin View Post
    I know there is some head tag to add to allow pages to display Japanese text but I'm not sure what it is as times have changed.
    There isn't. Displaying any particular set of glyphs is dependent upon at least two things - I might be forgetting something. A visitor must have a set of fonts capable of rendering the glyphs. I, for example, can't read Japanese on this machine because none of the fonts installed here includes Kana or Kanji characters. The document must also be written using an encoding scheme that can represent the necessary character (and of course a user agent must be able to handle that scheme).

    I remember using something with the term 'UTF-8' in it.
    UTF-8 is one of the Unicode encoding schemes. Whilst most known characters can be expressed using UTF-8, it may be more efficient to use UTF-16. It depends how many characters from the U+00..7F range (7-bit ASCII) are included in the document.

    Author your documents in an editor capable of reading and writing Unicode characters, and save those documents using either the UTF-8 or -16 encoding schemes. Upload them to your server and ensure that it will send the correct Content-Type header. How you accomplish this depends on the server you are using, and what ability you have to configure it.

    Mike

  3. #3
    Join Date
    Mar 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I was asking the wrong question but I did figure it out, thank you for the reply and sorry for seeming like an ass but I'll post this for those looking:
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    I added that and my browser rendered the Japanese properly, otherwise it came up as jibberish even with Japanese support installed. But that was my fault for wording the question incorrectly. Sorry and thanks again.

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bubbletin View Post
    I was asking the wrong question
    No, you weren't (I knew what you were asking), and my answer stands: don't use a meta element. Ensure that the server is sending the necessary information. A meta element should be a last resort.

    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    Don't use XML-like syntax in a HTML document.

    Mike

  5. #5
    Join Date
    Mar 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    When you say don't use XML-like syntax could you please elaborate for someone with limited html knowledge?

    I'm more of a copy/paste type coder.. my kind is looked down upon by the great handcoders of the world but I can still get complex pages done and looking perfect in all browsers just requires more trial and error ^_- all your wisdom shared is very much appreciated.

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bubbletin View Post
    When you say don't use XML-like syntax could you please elaborate for someone with limited html knowledge?
    Serving XHTML as HTML on the Web seems to have become quite a popular thing to do, but not for any good reason. There are no advantages for users, and in fact it relies upon poor HTML processing implementations to even work properly (a correct SGML-based HTML processor would choke on this pseudo-XHTML). It's become so ubiquitous that even HTML documents can be found containing XHTML fragments.

    The sort of thing that I'm referring to is code such as:

    Code:
    <img ... />
    <meta ... />
    <script ... src="..." />
    These are legal within XHTML documents (if served as XHTML), but not HTML. The first two are actually equivalent to:

    HTML Code:
    <tag ...>&gt;
    That is, the element followed by a greater-than symbol (>). It's a rare thing to find a user agent that would act this way, but that's no reason to jump on this particularly wobbly wagon.

    The last example is more serious though; it's the same as writing

    HTML Code:
    <script src="..."></script>
    in XHTML, but

    HTML Code:
    <script src="...">&gt;
    in HTML. The most important thing to note, though, is that there's no end-tag. Indeed, present this to IE and the document will break rather horridly.

    You'll find quite a lot of material on the Web regarding serving XHTML as HTML. The most famous and frequently cited treatise is written by Ian Hickson (also known as Hixie) entitled sending xhtml as text html considered harmful.

    Mike


    XHTML is an application of XML. That is, XHTML is rooted in the syntactic and semantic rules and conventions of XML.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •