Results 1 to 3 of 3

Thread: Remove non-latin characters from string

  1. #1

    Thread Starter
    Hyperactive Member Cyb3rH4Xter's Avatar
    Join Date
    May 2009
    Location
    Sweden
    Posts
    449

    Remove non-latin characters from string

    I need to handle lots of different files, and now I got an error because a file had Chinese characters in it, which are converted to ???? during handling.

    Is there any good/fast method of checking a string and remove all characters that isn't from the latin alphabet?

    I live in Sweden so characters like "Å Ä Ö" shall remain intact in the filename

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Remove non-latin characters from string

    It sounds like you must be using the wrong encoding when reading the file in the first place.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member Cyb3rH4Xter's Avatar
    Join Date
    May 2009
    Location
    Sweden
    Posts
    449

    Re: Remove non-latin characters from string

    I tracked down the problem, and it isn't my code that can't handle the Chinese. It is the program I am using in my program.

    I am using a third-party CLI and that program can't handle Chinese characters. So I do need to remove them. Any tip?

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