Hello Friends,

Greetings of the day!

How can i change my existing website in UTF-8, which is now in iso-8859-1 ????

And is it necessary for web sites to be in UTF-8 for South East Asian languages ????

I am quite afraid if so :(.

Revert awaited.


Thanks & Regards

Dani AI

Generated

Short clarification linked to the thread: changing the page declaration alone (what suggested) only tells the browser how to interpret the bytes — it does not rewrite the files or database. The garbled text that saw after copying from Word usually means the bytes and the declared charset disagree (or the server is sending a different charset). ’s notes about language and direction are useful for rendering, but they won’t fix underlying encoding mismatches.

A practical, low-risk workflow: make a full backup and work on a copy; convert a few pages first and verify rendering in a dev browser before touching the live site. Static files can be batch-converted on a shell with iconv, for example:

for f in *.html; do
  iconv -f ISO-8859-1 -t UTF-8 "$f" -o "$f.utf8" && mv "$f.utf8" "$f"
done

Save files as UTF-8 without a BOM. Check the HTTP response header for Content-Type; a server header will override the page declaration. For servers:

# Apache (.htaccess)
AddDefaultCharset UTF-8

# nginx (server block)
charset utf-8;

Dynamic content and databases need special attention. Convert the database and tables to utf8mb4 and set the connection charset in the app. Example SQL and PHP:

ALTER DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

$mysqli->set_charset('utf8mb4');

Notes for Word-sourced content and troubleshooting: export/save Word text explicitly as UTF-8 plain text (or save as HTML with UTF-8), then paste into pages encoded in UTF-8. If text appears like "Français" or lots of replacement characters, that indicates a decode/encode mismatch — compare the file’s bytes, the server Content-Type header (DevTools → Network), and the page declaration. Also confirm fonts for South East Asian scripts are available (use suitable web fonts or system fallbacks) and keep language/dir attributes (as advised) so browsers handle direction and hyphenation correctly.

Recommended Answers

All 5 Replies

Just add

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

as first thing after <head>.
As for South East Asian languages I'm not sure, but I think using utf-8 will do no harm. Al the characters of those languages are incorporated in utf-8.

Just add

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

as first thing after <head>.
As for South East Asian languages I'm not sure, but I think using utf-8 will do no harm. Al the characters of those languages are incorporated in utf-8.

1st of all Thanks for replying.

But it seems you didn't get me, what i said.

It's not my concern whether UTF-8 will harm or not.
But my concern is how i can change my entire website in UTF-8 ???

Just changing the meta tag will change the entire code ???

Because earlier this website was in English & designed in iso-8859-1.
But now my client wants it run in all regional languages. I have all the content in MS word.

So what i have to do now is just to copy & paste them to HTML pages ??? I had tried the same but when i looked those pages in browser font were looking too different & even not readable & impossible to understand.


Please suggest me in this regard.

Hope this time i'll be successful to make readre's understand. !!!


Thanks & Regards

Here you can find more info about meta tags: http://www.w3.org/International/O-charset. In short, the meta tag is read by the browsers and the browser will display the page in utf-8 (if your meta tag is to use utf-8).

If the whole site is already there, all you have to do is open each page in an editor that understands utf-8. After opening, just save it again as utf-8 encoded. Under windows you can even use notepad for this. (File, Save-as and under encoding choose utf-8).

If you only have the text in Ms-Word, you need to copy it to an utf-8 editor and save it from there as utf-8 encoded.

But the first thing you can try is using the meta tag, and see how the site looks like. With any luck, that's all you have to change.

Member Avatar for Member #120589

As well as this, you should place text direction and language attributes into your html tag, e.g.

<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" lang="ar-sa" xml:lang="ar-sa">

For Saudi Arabian Arabic. RTL means right-to-left. If dir is left out, it defaults to left-to-right.
You can also include the language meta tag:

<meta http-equiv="Content-Language" content="ar-sa"/>

If you site is multilingual, you should place these 3 attributes in the containing tags, e.g.

<div dir="rtl" lang="ar-sa" xml:lang="ar-sa">
 <p>مرحبا العالم</p>
</div>
<div dir="ltr" lang="en-gb" xml:lang="en-gb">
 <p>Hello World</p>
</div>
<div dir="ltr" lang="hi" xml:lang="hi">
 <p>नमस्ते दुनिया</p>
</div>

This is really useful as you can style different languages:

<style type="text/css">
[lang|=en]
{
color:green;
}
[lang|=hi]
{
color:blue;
}
[lang|=ar]
{
color:red;
}
</style>

The "|=" ensures that all country-specific languages are included (e.g. |=en , will apply to en-us, en, en-gb, en-au etc)

Thanks a lot for all the replies.

I am extremely Sorry as i didn't close it. In future i'll take care of it.

Thanks & Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.