On 11/13/21, Terry Reedy
On 11/13/2021 4:35 PM, ptmcg@austin.rr.com wrote:
_πβ ¬π π²πβπͺLα΄°π¬π½οΉπ·πΌπ‘ = 12
def _π°Κ°πΈΚ³π₯ππ(π°, pππ’ο¬ππππ, ο½α΅€ππ³ππ₯πΉβπ):
Λ’πΈο½π½ = π₯ο½ π―(π) - ο½rπππ’xπ α΅π· - ππͺο¬ο½π πΉπβ
if sο½iπ± > _πππ ππ΄HπΊοΌ¬π―πποΉLππ©:
π΄ = '%s[%d chars]%s' % (π¨[:π±π«πππο½βππ], βππp, πΌ[πππ(π) - π¨ππο¬xπ‘α΅π―:])
return β
* Does not at all work in CommandPrompt
It works for me when pasted into the REPL using the console in Windows 10. I pasted the code into a raw multiline string assignment and then executed the string with exec(). The only issue is that most of the pasted characters are displayed using the font's default glyph since the console host doesn't have font fallback support. Even Windows Terminal doesn't have font fallback support yet in the command-line editing mode that Python's REPL uses. But Windows Terminal does implement font fallback for normal output rendering, so if you assign the pasted text to string `s`, then print(s) should display properly.
even after supposedly changing to a utf-8 codepage with 'chcp 65000'.
Changing the console code page is unnecessary with Python 3.6+, which uses the console's wide-character API. Also, even though it's irrelevant for the REPL, UTF-8 is code page 65001. Code page 65000 is UTF-7.