Converting accented letters into special HTML characters

Discussion about HTML and XHTML related issues.
Post Reply
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 1
Joined: Mon Jul 05, 2010 1:39 pm

Converting accented letters into special HTML characters

Post by masterseo » Mon Jul 05, 2010 1:44 pm


Pls, any software is there to convert accented letters into special HTML symbols?

For example:

À - À
Ê - Ê

I have Dreamweaver 9 (CS3) but do not know how to convert.

Thank you!

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3453
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Converting accented letters into special HTML characters

Post by Albert Wiersch » Wed Jul 07, 2010 8:29 am


I do not know about Dreamweaver, but HTML Tidy may do what you want. I just did a brief test and it did change À to À. You may have to "play" with the settings because it may also try to fix and reformat your page and you may not want that.

CSE HTML Validator has an interface to HTML Tidy. You may want to try that. You can try the trial on the website or the free BETA:

Other programs integrate with HTML Tidy as well. I hope this helps.
Albert Wiersch

User avatar
Rank VI - Professional
Rank VI - Professional
Posts: 711
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Re: Converting accented letters into special HTML characters

Post by MikeGale » Thu Jul 08, 2010 10:39 pm

I don't know what programs and approaches you are used to.

Here's a couple of approaches that I have used in the past. (There may be online web services that do it too. I haven't checked.)

1) Write a little program that does a search and replace. Pretty trivial in the development environments I'm envisaging. The harder bit is getting a list of the entities and their conversions.

2) Use HTMLTidy as Albert suggests. If doing that it might be worth looking at the result and if it's really badly fouled up (and not fixable), try using a diff tool to update the "good" copy.

Depends how often you want to do it and what entities you encounter.

(I have a feeling HomeSite did that but Adobe have killed the product.)

Some text editors do this, but they'll often convert angle brackets to their encoded form. So you'll have to revert them afterwards.

User avatar
Rank II - Novice
Rank II - Novice
Posts: 46
Joined: Sun Oct 01, 2006 2:18 pm
Location: CA

Re: Converting accented letters into special HTML characters

Post by CaryD » Sun Jul 11, 2010 2:45 pm

Dr. Kral
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 2
Joined: Sat Nov 06, 2010 12:38 pm

Re: Converting accented letters into special HTML characters

Post by Dr. Kral » Tue Feb 01, 2011 1:50 pm

I just saw this and thought I would comment.

It is not necessary to convert those non-basic characters in HTML as you can use unicode (charset=UTF-8) provided that Dreamweaver allows you to. If not, try a European code set such as iso-8859-15 which allows such exotic characters.

On the other hand, if you must insert something into a page which you can not set to such character sets but uses iso-8859-1 then you can do a conversion using javascript.

Here the essence of the function:
asd=asd.replace(/([^\u0000-\u00A0])/g,function(a){return "&#"+a.charCodeAt(0)+";"}) ;

If you want named entities, then you can extract them from a list such as at <<>>

The nice thing about getting numeric entities is that the conversion is compact.

<title>Convert to entities</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="CSE HTML Validator Professional (">
<script type="text/javascript"><!--
function trans() {
document.getElementById("aa").value.replace(/([^\u0000-\u00A0])/g,function(a){return "&#"+a.charCodeAt(0)+";"})
return }
<p><button onclick='trans()'>Trans</button></p>
<p><textarea id="aa" rows="10" cols="50"></textarea></p>
<p><textarea id="bb" rows="10" cols="50"></textarea></p>

Post Reply