Convert to UFT8 without BOM...
mlcvista opened this issue · 3 comments
mlcvista commented
Hello,
Is it possible to convert an Ainsi Text file to UFT8 without BOM, with UniConv ?
Big thank you for your great UniConv.
With Best Rehgards,
Michel
d-mozulyov commented
Hello,
Sure it is possible
You should initialize TUniConvContext-instance with UTF8<--SBCS(Ansi) encodings, and call Convert function
Look FileConversion.dpr demo
You can also use CachedTexts library: https://github.com/d-mozulyov/CachedTexts
It has automatically conversion classes
It should be something like that:
Reader := TByteTextReader.CreateFromFile(CODEPAGE_UTF8, FileName);
while (not Reader.EOF) do
begin
Stream.Write(Reader.Current^, Reader.Margin);
Reader.Skip(Margin);
Reader.Flush;
end;
mlcvista commented
Big thank you for your help, I'll test your solution.
d-mozulyov commented
Hope it will be useful for you :)