March 3, 2013

Korean is not recognized in HTML page

Question by ProgrammingNerd

When I type Korean in my html code and open it through my browser, Korean is not recognized by the browser and prints some weird words. What shall I do?

Answer by Starx

There must be few mistakes you are making.

  • First, You should have a doctype specified on your HTML page. Use HTML5 doctype

    <!DOCTYPE html>
    
  • Second, you should specify the character encoding of the document as well. So, add:

    <meta charset="utf-8" />
    

    In your head section. Or for a longer version with better cross browser compatibility use:

    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
    

Also as Juhana said, your file must be saved with same encoding (i.e. Unicode UTF-8) to be able to store Unicode characters and display them.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!