Python Forum
idle and characters with decimal value>127
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
idle and characters with decimal value>127
#1
If I running python 3.8 in the terminal do
print(chr(65)+chr(128))
I get the expected result
A�
but if I execute the same command in idle 2.7.12 the result is just an empty line.
Is this a bug or is it a feature?
H
using Ubuntu 16.04
Reply
#2
I think there is no normalized transcription for control characters 128 to 159. In the french Wikipedia page, they advise against using these characters because of the lack of norm. The character shown in the terminal is a placeholder instead of the actual corresponding glyph.
Reply
#3
(Jun-16-2021, 07:34 AM)hakelm Wrote: If I running python 3.8 in the terminal do
print(chr(65)+chr(128))
I get the expected result
A�
but if I execute the same command in idle 2.7.12 the result is just an empty line.
Is this a bug or is it a feature?
H
using Ubuntu 16.04

Python 2.x is obsolete, and irrelevant to modern programming. So whether it is a bug or a feature is irrelevant. In any case, a single test is not indicative of anything. But just stop using Python 2.x. It is out of support and officially deprecated. See https://www.python.org/doc/sunset-python-2/

And that is not the expected result. The expected result is A€, since the Euro sign is supposed to be in position 128 in most fonts, in the lower 8-bit set. Have you selected the right font for your output window/console? Or do you even have a modern font installed?
Reply
#4
Euro sign may be in position 128 for extended ascii, but for unicode it is in position 8364. I wouldn't say € is normally expected to display chr(128). The idle editor correctly displays a euro sign for chr(8364).
Reply
#5
Thanks all,
I didn't realise that my freshly installed idle wasn't up to date and didn't use my python3.
idle3 works better and delivers "proper" results. Below output for 127<ord©<256. All characters aren't displayed the same way as in my idle3.
H
============================ RESTART: /root/c.py ============================
‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
>>>
Reply
#6
This output looks very much like latin-1. Note that characters 127 to 160 don't produce visible output.
Reply
#7
Pasting characters 128-160 directly here results in nothing visible.
I don't know what character set idle3 uses but idle3 produces those seen below the only invisible one is chr(160).
   

It doesnt look exactly as Latin1 or ISO/IEC 8859.
Reply
#8
This looks somewhat in contradiction with your previous post. What reproducible steps did you follow to get this output in idle?
Reply
#9
As I said above, I replaced idle with idle3
H
Reply
#10
This doesn't tell me which code produced this output.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Remove escape characters / Unicode characters from string DreamingInsanity 5 13,420 May-15-2020, 01:37 PM
Last Post: snippsat
  testing for Decimal w/o importing decimal every time Skaperen 7 4,363 May-06-2019, 10:23 PM
Last Post: Skaperen
  mixed decimal point characters Skaperen 1 2,158 Mar-10-2019, 05:23 PM
Last Post: stullis
  IDLE not importing pygame (ok outside of IDLE) miner_tom 1 3,281 Sep-14-2018, 07:54 PM
Last Post: Larz60+
  IDLE crash using special characters? reikonaga 6 4,670 Aug-06-2018, 07:37 AM
Last Post: keegan_010
  Python IDLE 3.6.2 on WIn7 vs Pyhton 3 IDLE raspberry djdan_23 5 5,651 Sep-07-2017, 12:51 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020