Re: [Phix] ? operator; string behavior
- Posted by petelomax Nov 07, 2017
- 1180 views
There is a c>#7E on line 31 in function allascii in builtins\VM\psprintN.e that you might want to change to c>#FF
Should the ? operator output utf8 strings?
Can't say that has ever occurred to me. I generally view ? as a quick-and-dirty diagnostic that usually gets "it" (/the mind-reading thing) wrong anyway - eg this week I had a {3,4} that was not so helpful, so I whipped up a quick routine to show it as {PRE_SIB,POST_SIB}, somewhat more meaningful to me at the time. I might estimate that about 1 in 5 times I immediately replace a ? with pp(), printf(), or whatever, so I guess I have become pretty immune to any shortcomings. Another classic for me is ?ch --> printf(1,"%c\n",ch) or perhaps the ?""&ch or ?ch&"" trick.
No matter, the above change should do you proud anyways, since (I think) utf8 deliberately avoids bytes <#32.
Pete