Pop-Up Thingie
Sidebar
>>> Magnum BBS <<<
Home
Forum
Files
Dark
Log in
Username
Password
Sidebar
Forum
Usenet
COMP.LANG.PYTHON
MicrosoftDefault: a codec to adapt Python to the Win11 Terminal
From
moi
@21:1/5 to
All
on Tue Nov 8 00:47:31 2022
MicrosoftDefault: a codec to adapt Python to the Win11 Terminal
Not really a "codec", but the spirit is here.
PS C:\humour>
PS C:\humour> get-content ms52.txt
abc霟
PS C:\humour> py38 get-text-file.py ms52.txt
abc霟
PS C:\humour> get-content ms52.txt -encoding default
abc霟
PS C:\humour> py38 get-text-file.py ms52.txt -encoding MicrosoftDefault
abc霟
PS C:\humour>
PS C:\humour> # so far, so good
PS C:\humour> # let’s store the content...
PS C:\humour>
PS C:\humour> $a = get-content ms52.txt
PS C:\humour> # $b = py38 get-text-file.py ... will not work properly
PS C:\humour> # new test file
PS C:\humour>
PS C:\humour> $a = get-content ms52-a.txt -encoding default
PS C:\humour> $b = py38 get-text-file.py ms52-a.txt -encoding MicrosoftDefault PS C:\humour> $a -eq $b
True
PS C:\humour>
PS C:\humour> # good, except a small annoying problem
PS C:\humour> $correct = get-content52 ms52-a.txt
PS C:\humour> $a -eq $b
True
PS C:\humour> $a -eq $correct
False
PS C:\humour> $b -eq $correct
False
PS C:\humour>
Software can be really funny...
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
Who's Online
Recent Visitors
Bob Worm
Tue May 7 21:37:57 2024
from
Wales, Uk
via
Telnet
Michal Wronka
Wed May 8 21:31:48 2024
from
Wroclaw, Poland
via
SSH
Cronus
Wed May 8 19:22:39 2024
from
Provo, Ut
via
SSH
Michal Wronka
Wed May 8 18:58:52 2024
from
Wroclaw, Poland
via
SSH
System Info
Sysop:
Keyop
Location:
Huddersfield, West Yorkshire, UK
Users:
300
Nodes:
16 (
2
/
14
)
Uptime:
74:35:26
Calls:
6,715
Calls today:
3
Files:
12,246
Messages:
5,357,276