LeStegii / server-software

This repository contains lists of server softwares for minecraft
https://lestegii.github.io/server-software/
217 stars 14 forks source link

fix weird encoding #83

Closed lunofe closed 5 months ago

lunofe commented 5 months ago

I've just spent two hours troubleshooting why I wasn't able to parse this file in Python. Turns out, there's some crazy encoding going on in this single file.

vanilla_bedrock = "# ️️✔️ Active Development"
anything_else   = "# ✔️ Active Development"
print(vanilla_bedrock == anything_else)

for char in vanilla_bedrock[:8]:
    print(f"'{char}': {ord(char)}")

for char in anything_else[:8]:
    print(f"'{char}': {ord(char)}")
False

'#': 35
' ': 32
'️': 65039   ⁉️
'️': 65039   ⁉️
'✔': 10004
'️': 65039
' ': 32
'A': 65

'#': 35
' ': 32
'✔': 10004
'️': 65039
' ': 32
'A': 65
'c': 99
't': 116
LeStegii commented 5 months ago

Very interesting, no idea what caused that. Thanks for the PR!