locked
Stripping Unicode Characters - how to make "São Paulo" into "Sao Paolo"? RRS feed

  • Question

  • User1085970526 posted

    Hi,

     I have an asp.net app that needs to output text that might have some unicode characters.

     Is there an easy way to strip out all of the wierd foriegn characters and return good old fashioned ASCII?

     Something like this would be great:

     string niceString = CleanUpUnicode(stringWithUnicode);

     Thanks,

    John 



     

    Thursday, January 4, 2007 5:41 PM

All replies

  • User-1205307838 posted

    i do something like that to clean text from polish characters

    ' ''description = description.Replace("ê", "e")

    ' ''description = description.Replace("¹", "a")

    ' ''description = description.Replace("œ", "s")

    ' ''description = description.Replace("¿", "z")

    ' ''description = description.Replace("Ÿ", "z")

    ' ''description = description.Replace("æ", "c")

    ' ''description = description.Replace("ñ", "n")

    ' ''description = description.Replace("³", "l")

    ' ''description = description.Replace("ó", "o")

    ' ''description = description.Replace("š", "a")

    ' ''description = description.Replace("¶", "s")

    ' ''description = description.Replace("±", "a")

    ' ''description = description.Replace("¦", "s")

    Thursday, January 4, 2007 7:51 PM