[Issue 1482] std.file docs are insufficient

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 12 05:07:52 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1482





------- Comment #4 from thecybershadow at gmail.com  2007-09-12 07:07 -------
(In reply to comment #3)
> It's essentially the same as char[] as well, then, right?  A char is really
> just  a byte that is given preferential treatment as a UTF-8 string, no?

Indeed (also character literals don't implicitly cast to integers, and
vice-versa).

> The docs don't make this 100% clear.  I think it's mostly visual formatting,
> combined with a lack of a cohesive summary for the module.
> 
> A related doc note ...  I find that the docs make it difficult to distinguish
> the methods associated with a class when there multiple classes on a single
> page.  Again, I'd call it visual formatting.

It's true. I got the habit of just checking the library source most of the
time...

> Another issue I found is that I didn't get a definitive answer on whether
> reading files automatically treats them as UTF-8 or not.

The std.file routines treat the files as raw data. No conversion is performed.
You are free to operate on the data as you please, however Phobos routines that
take char[] arguments will usually expect them to be encoded in UTF-8.

Pretty sure there was a page about Unicode and UTF-8 in D somewhere...


-- 



More information about the Digitalmars-d-bugs mailing list