Re: sprintf() query
- Posted by petelomax Oct 25, 2017
- 1236 views
should the first argument be "output direction", when it is almost always "1" ?
Erm, "output device". Making printf("hi\n") work as printf(1,"hi\n") (and leaving printf(fn, "hi\n") undamaged) is a perfectly good and none-too-difficult suggestion.
should an output routine be able to output utf32 content to a utf8 terminal?
Unquestionably. The big roadblock on that, I think, is automatically configuring/detecting a Windows console to be utf8 (chcp 65001 or chcp 28591) and with a truetype font, rather than with printf() itself.
can the Phix string allow for a universal output routine that shows text and numbers "as expected"?
Not quite sure what you mean. Examples?
is it possible to create a new set of output routines that breaks from the DOS legacy?
Maybe. It will help no-one to deliberately break legacy code. As above, better detection is probably the key, and/or you can always create eg printfN().
Pete