Last active
January 12, 2026 02:09
-
-
Save rhee/a504e2fcad420ef5c9bee9e1f2046004 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # recover broken string (double decoded 'IBM PC OEM') | |
| # https://gist.github.com/rhee/a504e2fcad420ef5c9bee9e1f2046004 | |
| # | |
| import sys | |
| for broken_snippet in sys.stdin: | |
| # 1. Encode back to the 'IBM-PC' raw bytes | |
| # 2. Decode using CP949 (Korean) | |
| try: | |
| recovered = broken_snippet.encode('cp437').decode('cp949') | |
| #print(f"Recovered Text: {recovered}") | |
| sys.stdout.write(recovered) | |
| except Exception as e: | |
| print(f"Error: {e}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment