Jonathan Weiss wrote:> I work on a german site that obviously includes german words with umlauts
in
> its data.
> It seems like the html_escape function (or simply h() function) will not
> escape umlauts:
> <%=h "ä" %>
> Will not produce ä
> What is the best way to do this?
As far as I know, you actually don''t need to escape those -
it''s fine to just
put them in, as long as your character set supports them. Use iso-8859-1 or
utf-8, but not us-ascii, and you''ll be fine.
I built a site for an Austrian company and initially escaped them, but I
noticed on one page where I''d forgotten to do it that it was completely
valid
iso-8859-1 XHTML 1.0 Strict markup and didn''t cause any problems, so I
left
them unencoded and undid my encoded ones too.
Validates perfectly, so as far as I know, no problems.
Maybe there''s a variation of the h function that escapes all
characters,
including standard alphanumeric characters, but that''s probably
overkill.
Cheers,
~Dave
--
Dave Silvester
Rent-A-Monkey Website Development
Web: http://www.rentamonkey.com/