Jon,
I totally agree. Until iostreams treats a >21bit number as a unit, then to hell with it. Whenever we put(ch), ch = get(), or iterate over a stream, or randomly access a codepoint as stream[i], the codepoint needs to be able to handle a full Unicode character. People who arrived late into this might not appreciate why we did this. It's not "NIH" , I swear :-)
The braindead morons who designed iostreams believe the 1960s' theory that a 7 bit byte is a character.
Even if you consider UTF8 good enough, then you still must be able to grab a single Unicode character, which can be up to 6 (count em, six) bytes.
Ref here: http://www.unicode.org/ucd/
(For those who don't know, Jon has actually worked on Unicode as a day job, so we shouldn't argue with him :-)
bob(ishmal)
Jon A. Cruz wrote:
On Mar 13, 2008, at 10:51 AM, Krzysztof KosiĆski wrote:
I failed to notice that comment somehow, . I was also a bit puzzled that
there are "OutputStreams" and "Writers" instead of "stringbufs" and
"streams". I'll look into that a bit more once I'm done with the clipboard.
I think most of that comes from Java successfully addressing such issues (using the reasearch form Taligent), while C++ did not.
Just to go on naming, "stringbuf" sounds like it should be a buffer for a string. Perhaps some "writers" might write to those, but they might write to something else.
http://java.sun.com/docs/books/tutorial/essential/io/streams.html http://java.sun.com/docs/books/tutorial/essential/io/bytestreams.html http://java.sun.com/docs/books/tutorial/essential/io/charstreams.html http://java.sun.com/j2se/1.5.0/docs/api/java/io/package-summary.html
For the naming Java uses, "Streams" deal with transport of *bytes* and "Writers" deal with sending of *characters*.
Also in C there is no 'byte' only 'char' that means a byte but often is used for characters, and 'strings' are just arrays of 8-bit units that happen to have a zero value in one of their members. On the other hand Java has a 'byte' type for 8-bit data, a 'char' type for character data, and 'String' that is actually a class. in fact, all instances of string literals in Java programs are really instances of java.lang.String and you can do things like if ( "magic".equals(myVar) ) { }
Anyway, much of the reason to use terminology that sounds more like Java's than it sounds like C/C++ is that C/C++ terminology is very mismatched and ambiguous compared to Java's.
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel