Hi, @lfbrock.
I think this library will be good.
jschardet https://www.npmjs.com/package/jschardet
Many supported charsets not only Japanese.
https://www.npmjs.com/package/jschardet#supported-charsets
But I don't know whether there is a need to support non-UTF-8 format...
I hope you find that information helpful.