How to open and convert Chinese txt files to odt?

I am using Libre Office SDK 4.2.4.

I have written a C++ program that converts files to and from various formats. These all work well with english text files. I am failing to work out how to convert a chinese (and possibly other languages) from .TXT to .ODT. The interesting thing is I can preview the file in Finder on my MAC and see open the file in TextEdit without answering any questions - how do these tools achieve it and how can I get Libre Office to do it?

I don’t think it’s a Font issue as I can preview them in Finder and open it ok in TextEdit.

If I open the using “HTML” as the FilterName and “utf8” and the FilterOptions it nearly works - however the line feeds are not correct.

I have wrapped the Chinese Text in <html><head><body><pre> Chinese Text…</pre></body></head></html> and open via C++ as a HTML file and it converts perfectly. However this does not work for all languages - to fix it for all you need to convert the text to UTF8.

It is just a crazy idea. I would create a txt -file with Chinese text. Open it in Writer, save it as odt. Replace the odt- extension by zip, and unzip the file and try search for the answer.

I am failing to successfully open the document manually. Too many options considering that Finder and TextEdit open with no dialogs on Mac OS X.