Loading textfile into stringlist with firemonkey on osx when the encoding is unknown


I am having a hard time to load a textfile into a stringlist in firemonkey on osx when the encoding of the textfile in not known.

When I just use list.loadfromfile(filename), I get most of the time an exception regarding encoding.

list.loadfromfile(filename,TEncoding.unicode) will also fail when the file is in ansi, and opposite.

There is no issue on Windows, list.loadfromfile(filename) just works, but not on osx.

I cant specify the encoding, because it will be unknown (user provide the text files).

Any clue how I can get around this encoding issue when running the app on a mac?

Comments are closed.