Re: [Phix] ? operator; string behavior

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...

Phix ? operator

  • ? string of plain-text characters is output as text
  • ? string of utf8 characters is output as numbers

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

_tom said...

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu