• python3 not printing extended chars

    From Clive Reuben@1:142/104 to g00r00 on Thu Oct 6 11:09:38 2022
    Hey g00r00, I was wondering if you knew of a reason that embedded python3 would not be able to print extended characters... e.g. if I do:

    "write(chr(177))" it will print garbage....

    mps files work fine, so I know the system has to be at least partly configured correctly. And, other than that python3 works as expected.

    My setup is:
    Mystic 1.12 A48
    Rpi 4 4GB
    Raspian Bullseye

    Let me know if this is something that sounds familiar. Thanks!

    -Clive

    --- Mystic BBS v1.12 A48 2022/07/15 (Raspberry Pi/32)
    * Origin: oNyX bBs - onyxbbs.mywire.org:2300/2200 (1:142/104)
  • From Travis Mehrer@1:134/303 to Clive Reuben on Thu Oct 13 06:53:36 2022
    On 06 Oct 2022, Clive Reuben said the following...

    Hey g00r00, I was wondering if you knew of a reason that embedded
    python3 would not be able to print extended characters... e.g. if I do:

    "write(chr(177))" it will print garbage....

    I can somewhat confirm this; however, it's worth noting that since Python 3 uses unicode by default chr() doesn't behave the same as in Python 2. chr() will output the unicode character of that number.

    In a terminal you could use something like b'xc0'.decode('cp437') (sorry that's just the hex code for the character I was testing with) to output an ANSI character. But this also doesn't seem to output as expected with mpy.

    ... My software never has bugs. It just develops random features...

    --- Mystic BBS v1.12 A48 2022/07/15 (Raspberry Pi/32)
    * Origin: CaNerDUH BBS (1:134/303)
  • From Clive Reuben@1:142/104 to Travis Mehrer on Fri Oct 14 13:14:12 2022
    On 13 Oct 2022, Travis Mehrer said the following...

    On 06 Oct 2022, Clive Reuben said the following...

    Hey g00r00, I was wondering if you knew of a reason that embedded python3 would not be able to print extended characters... e.g. if I d

    "write(chr(177))" it will print garbage....

    I can somewhat confirm this; however, it's worth noting that since
    Python 3 uses unicode by default chr() doesn't behave the same as in Python 2. chr() will output the unicode character of that number.

    In a terminal you could use something like b'xc0'.decode('cp437') (sorry that's just the hex code for the character I was testing with) to output an ANSI character. But this also doesn't seem to output as expected with mpy.

    Hey Travis, That's a very good point and would tend to confirm my suspicion. Thanks, for the response!

    -seeLive

    ... The dreams you'd hear if the streets could talk.

    --- Mystic BBS v1.12 A48 2022/07/15 (Raspberry Pi/32)
    * Origin: oNyX bBs - onyxbbs.mywire.org:2300/2200 (1:142/104)