-**** Posted from Supernews, Discussions Start Here(tm) ****-
http://www.supernews.com/ - Host to the World's Discussions & Usenet
I don't think ascii covers this characters but get the ISO-Latin-1 code with
"é".charCodeAt()
"ä".charCodeAt()
You can use unicode escape sequences now to generate characters
"\u00E9"
"\u00E4"
> Thanks for your answer.
>
> Olivier
>
> -**** Posted from Supernews, Discussions Start Here(tm) ****-
> http://www.supernews.com/ - Host to the World's Discussions & Usenet
--
Martin Honnen
Email: mailto:Martin...@sector27.de
WWW : http://www.sector27.de/martin.honnen/
Define an associative array which maps the character in unicode representation
to the symbolical html entity:
var jsUnicode2htmlEntity = new Object();
jsUnicode2htmlEntity["\u00E9"] = "é"
jsUnicode2htmlEntity["\u00E4"] = "ä"
As there a numerical (character code) entities in html it suffices to use
function htmlEntity (c) {
if (typeof c == "string")
c = c.charCodeAt();
return "&#" + c + ";";
}
where for example
htmlEntity ("\u00E9")
yields
é
if you just want to convert a javastring character represenation to an html
character representation.
> Do you have any idea about this ?
>
> Thanks a lot.
>
> Oliver
>
> Martin Honnen a écrit:
>
> > Olive wrote:
> > >
> > > Hello,
> > >
> > > Does anybody know a javascript function wich permits
> > >
> > > to convert extended character like é, ä... in their ascii code ?
> >
> > I don't think ascii covers this characters but get the ISO-Latin-1 code with
> > "é".charCodeAt()
> > "ä".charCodeAt()
> > You can use unicode escape sequences now to generate characters
> > "\u00E9"
> > "\u00E4"
> >
> > > Thanks for your answer.
Keep questions in the newsgroups.