David Kastrup wrote:
Hans Hagen
writes: Jonathan Sauer wrote:
Hello,
slightly more efficient ... (char and byte accept multiple arguments) and you can use write which is faster too) Thanks!
in context i use something quick and dirty (no > 0x10000 checking but from your function i can deduce the magic umbers -) Well, they are simply the ones mentioned in http://en.wikipedia.org/wiki/Utf-16. sure, but i didn't realize that a simple / worked ok; trunc/round stuff and so
Oh, it doesn't work. It is the %04x which does the truncation. %04.0f in contrast rounds.
No idea whether this is documented/intended behavior.
i wonder too (format is not that well documented, mostly a reference to some c function); last week i found out that %4s works but also %-4s which was just a guess when i tried it -) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------