Detect File encoding

On a Scala learning and implementations, do i have any libraries that can detect the file’s encoding ?

I want to know whether the file i receive from my users is UTF-8 / UTF-16 / ISO -8859- X / SJIS .

Please help me with your inputs for detecting the files’ encoding using Scala.

Thanks for all your inputs in advance.

It’s relatively unlikely that there would be a Scala-specific solution to this; I’d suggest looking for a Java library that will do it, and then you can call into that library from Scala. See file - Java : How to determine the correct charset encoding of a stream - Stack Overflow

Hi @SethTisue , Wishes to you. Thanks for your inputs.

I will check your recommended links and let you know the observations from my trials.