Skip to content

Instantly share code, notes, and snippets.

@lixiaoquan
Created November 22, 2023 03:44
Show Gist options
  • Save lixiaoquan/eb01b24c0824a287c4d12312443cf824 to your computer and use it in GitHub Desktop.
Save lixiaoquan/eb01b24c0824a287c4d12312443cf824 to your computer and use it in GitHub Desktop.
Decode special characters in Cygwin path
ss = "\uf03a"
print(f"Unicode char used by cygwin to represent : in path {ss} {[ss]}")
value = ord(ss)
print(f"Convert it to hex number {(hex(value))}")
# https://cygwin.com/cygwin-ug-net/using-specialnames.html
value -= 0xf000
new_unicode_char = chr(value)
print(f"Subtract 0xf000 -- {new_unicode_char}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment