|
-
Oct 8th, 2011, 09:20 AM
#1
Thread Starter
Hyperactive Member
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
-
Oct 8th, 2011, 08:21 PM
#2
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.
-
Oct 9th, 2011, 03:53 AM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|