There is already a basic implementation of charset detection implemented in the writer text import as SwIoSystem::IsDetectableText:
http://opengrok.libreoffice.org/xref/writer/sw/source/filter/basflt/iodetect.cxx#427
It old and ugly, but could be a starting point. Obviously, it would have to be moved out of writer and polished a bit so that it can be used in other applications too.
There is already a basic implementation of charset detection implemented in the writer text import as SwIoSystem: :IsDetectableTe xt:
http:// opengrok. libreoffice. org/xref/ writer/ sw/source/ filter/ basflt/ iodetect. cxx#427
It old and ugly, but could be a starting point. Obviously, it would have to be moved out of writer and polished a bit so that it can be used in other applications too.