Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect a file's encoding?

Tags:

go

I'm trying figure out the encoding of a file on Windows using Go. Doing some research, I've found many recommendations for Mozilla's Charset Detectors (chardet), but they're hard to compile, and I'm not having any luck.

I've also found libguess, and it seems is widely used in Linux, but I can't make it work in Windows.

What's the best way to go about this? Is there a de-facto standard library to use with Go on Windows?

like image 794
Allen Dang Avatar asked Jan 12 '12 15:01

Allen Dang


1 Answers

You can use python package: chardet.

like image 72
kev Avatar answered Nov 09 '22 15:11

kev