[Tutor] Working with Umlauts

Tom Churm churmtom@hotmail.com
Fri Jan 17 05:49:01 2003


hi,

i need to replace umlauts in a string.  something that looks, very 
inelegantly, like this:

lastNameOfUser = string.replace(lastNameOfUser,"ä","ae")
lastNameOfUser = string.replace(lastNameOfUser,"ö","oe")
lastNameOfUser = string.replace(lastNameOfUser,"ü","ue")
lastNameOfUser = string.replace(lastNameOfUser,"ß","ss")
lastNameOfUser = string.replace(lastNameOfUser,"Ä","Ae")
lastNameOfUser = string.replace(lastNameOfUser,"Ö","Oe")
lastNameOfUser = string.replace(lastNameOfUser,"Ü","Ue")

but then i get the error that:
UnicodeError: ASCII decoding error: ordinal not in range(128)

and i get this same error when i try to use:
string.replace(lastNameOfUser,chr(228),"ae") ## for 'ä'

there's gotta be a quick & easy solution for this, but i'm afraid i don't 
know what it is...

--tom





_________________________________________________________________
The new MSN 8 is here: Try it free* for 2 months 
http://join.msn.com/?page=dept/dialup