none
Convert Characters RRS feed

  • Question

  • Hi

    We have a website contact us form. Users from different countries provide information. For e,g. people in vietnam input values 

    and this is coming as Name. H� TRỌNG  ĐẠI

    I tried https://r12a.github.io/app-conversion/ this app and it returns correct value  like "H� TRỌNG  ĐẠI".

    How can I do this in C# .net? I would like to remove that replacement character also.

    Friday, January 17, 2020 9:00 PM

All replies

  • Convert it to what? You are allowing users to enter information in their own language. You cannot auto-translate that to English if that is what you are looking for. There are third party services that can make a best guess estimate but they are in no way accurate.

    Note that the string you gave appears to be HTML encoded because you have Ọ which look like the hex code. To HTML decode use the HttpUtility.HtmlDecode method. This converts it back to Unicode but in whatever language they were using.


    Michael Taylor http://www.michaeltaylorp3.net

    Monday, January 20, 2020 4:54 PM
    Moderator
  • Hi myCrmGuy,

    Thank you for posting here.

    I  think HttpUtility.HtmlDecode is not a good choice.

    It can work well when decoding some common characters, but if it involves some small languages (Vietnamese, Greek, etc.), it often cannot recognize these special characters.

    I know this problem for some time, but so far, I still don't know how to solve this problem, if there is new progress, I will inform you immediately.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 21, 2020 3:07 AM