Results 1 to 2 of 2

Thread: help with character code issues

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    help with character code issues

    Hello all,
    I have an app where I am reading in text from a Word doc and an Excel spreadsheet, and some of the text contains characters such as "smart" quotes and apostrophes, different kinds of hyphens (dashes) and various European characters with accents and diacritical marks. I need to identify such characters and convert them to "straight" quotes, apostrophes, hyphens and unaccented characters respectively (yes, I know the meaning of a word can change depending on whether a character is accented or not, but that is OK for my purposes - for example if I come across "café" I want to convert it to "cafe").

    How can I use the Encoding namespace (or whatever other functionality is appropriate) to loop through a given string and get the Unicode values for each character? Once I have the Unicode value of a character to be replace, I'll want to replace it with the appropriate character.
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,397

    Re: help with character code issues

    Take a look at the Encoding.Convert method.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width