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 :)
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.
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?