Unicode and Bytes
Posted Nov 15, 2009 0:31 UTC (Sun) by
pboddie (guest, #50784)
In reply to:
Python user here by anselm
Parent article:
Python moratorium and the future of 2.x
In Tcl there is no notion of separate »byte strings« and »Unicode strings«. Things just work.
Maybe they do. It's probably no accident that custody of Tcl was with Sun around that time (or slightly earlier) and that Java APIs also occasionally have byte sequences becoming proper strings with a sprinkling of magic, although I forget where this was - probably the Servlet API, where you mostly do want strings, but where deficiencies in the standards require a bit of guesswork to actually provide correct strings (and not just bytes) to the API user when they ask for a request parameter or part of a URL.
Of course, there's nothing to stop you storing byte values in a Unicode string type: Jython managed to do this, too. But again, cross your fingers that the right magic is being used.
(
Log in to post comments)