[fpc-pascal] How to know the encoding of a string?

Marcos Douglas B. Santos md at delfire.net
Tue Oct 18 13:08:10 CEST 2016

On Mon, Oct 17, 2016 at 11:21 AM, Graeme Geldenhuys
<mailinglists at geldenhuys.co.uk> wrote:
> No such function [with exact results] exists anywhere (no matter the
> programming language). The best programs can do is to interrogate the
> contents of a file and make a best guess.  How they do that
> interrogation -- I unfortunately don't know. I guess you could look at
> the source code of some of the open source text editors and see what
> they do. Some text editors are much better than others. eg: EditPad Pro
> (commercial) and jEdit (open source) are very good at these interrogations.

Thanks. I'll try http://chsdet.sourceforge.net (Jonas' tip).

> Alternatively, simply ask the person that supplies you with these files
> to tell you want encoding they use. They must know the answer.

It's not so simple... :)

Marcos Douglas

More information about the fpc-pascal mailing list