ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There is no reliable way - it's 8 bit, like several other common encodings.
ISO 8859-1 is no longer a maintained standard, but that doesn't help.
The other problem is Windoze. It makes files with non-standard "Latin1" encodings, I think it's Windows standard 1224 (?). You cannot distinguish a windows "Latin1" file from a real ISO 8859-1 file without being able to put it in a reader. And even then it might not be obvious.
Based on the above list of characters provided, can I now make a condition like if decimal value greater >= 32 and <= 255, the character is possibly a character from latin1 encoded character set ?
Well, other encodings are also using this range.. so you can not and as said before, only your eye will tell you if it's correct..
Using iconv or convmv you could bruteforce (means try all combination) and then look at them. Or rather than looking at them, you could then analyse words based on a dictonnary. Statistically, taking the one that has the more recognized words should be the good one. (yeah.. it needs some work..)
So, basically am trying to filter out the utf-8 encoded strings from my collection base,
as my collection base is mixed of latin-1 and utf-8 encoded strings, this problem arised.
As you said, it would definitely overlap and am just thinking of a way, where you could
either extract the components that are utf-8 encoded
or
the components that are latin-1 encoded
if atleast one of the way is working, it would be great!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.