Parsing a UTF-16LE file line by line, BUG?

Daniel Kozák via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 4 12:00:20 PST 2017


Nestor via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> 
napsal St, led 4, 2017 v 8∶20 :
> On Wednesday, 4 January 2017 at 18:48:59 UTC, Daniel Kozák wrote:
>> Ok, I've done some testing and you are right byLine is broken, so 
>> please fill a bug
> 
> A bug? I was under the impression that this function was *intended* 
> to work only with UTF-8 encoded files.

Impression is nice but there is nothing about it, so anyone who will 
read doc will expect it to work on any encoding.
And from doc I see there is a way how one can select encoding and even 
select Terminator and its type, and this does not works so I expect it 
is a bug.

Another wierd behaviour is when you read file as wstring it will try to 
decode it as utf8, then encode it to utf16, but even if it works (for 
utf8 files), and you end up with wstring lines (wstring[]) and you try 
to save it, it will automaticly save it as utf8. WTF this is really 
wrong and if it is intended it should be documentet better. Right now 
it is really hard to work with dlang stdio.

But I hoppe it will be deprecated someday and replace with something 
what support ranges and async io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20170104/66c43d4f/attachment.html>


More information about the Digitalmars-d-learn mailing list