views:

112

answers:

2

How to display Korean Text in a webpage. i have been using these meta tags and headers

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="ko"/>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>

ini_set('default_charset', 'UTF-8');
header('Content-Type: text/html;charset=utf-8');

But nothing works.. please help!!

NOTE: I tried every tag 1 at a time not all at once.

+1  A: 

Your example has two META tags - one is UTF-8 and the other is ISO-8859-1.

pygorex1
i tried that 1 at a time not all at once
Treby
+2  A: 

Use:

ini_set('default_charset', 'UTF-8');
header('Content-Type: text/html;charset=utf-8');
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

and make sure your editor is configured to save using UTF-8, and make sure that any other systems involved (e.g. databases) are configured to use utf-8.

David Dorward
actually im using notepad++ as my editor and it can read korean language. but when i view my page in the web browser it doesn't read as it is.
Treby
do i need to use these tags all at once
Treby
Remember to be sure header comes BEFORE any output at all, as in the first line is <?php header('...') ?>, then afterwards your html. Reference http://www.php.net/manual/en/function.header.php
ux9i
@Treby — That just means that notepad++ can cope with whatever encoding you are using. It doesn't mean that you are using UTF-8. You have to **use** UTF-8 (or whatever) and **say** you are using UTF-8 (or whatever).
David Dorward
@Treby — The ini_set is probably redundant. You need the real HTTP header for when the page is accessed from a webserver, and the http-equiv for when it is saved and accessed from somewhere other than the webserver.
David Dorward
Your Right about the editor.. i go toFormat> Convert to UTF-8
Treby