Sample Header Ad - 728x90

Revert filenames after they were garbled by using different encoding

6 votes
1 answer
333 views
I have a file
СМП бваг™вга†
The first three letters are proper Cyrllic and the remaining part is [*mojibake*](https://en.wikipedia.org/wiki/Mojibake) . > "_Mojibake_ is the garbled or gibberish text that is the result of text being decoded using an unintended character encoding." — Wikipedia Originally, it was
СМП структура
but then garbled somehow, most probably because of the file has been zip-ped on Windows XP and then un-zipped on a Mac, by an unskillful user. I tried to fix it using convmv and iconv, like this:
convmv -r -f cp1251 -t utf-8 DIR
ls | iconv -f cp1251 -t cp850 | iconv -f cp866
but didn't succeed yet. Could someone help with this? **update 1** Hexdump of СМП бваг™вга†:
0000000    d0  a1  d0  9c  d0  9f  20  d0  b1  d0  b2  d0  b0  d0  b3  e2
           С   **  М   **  П   **      б   **  в  **   а  **   г   **  ™
0000020    84  a2  d0  b2  d0  b3  d0  b0  e2  80  a0  0a                
           **  **  в  **   г  **   а   **  †   **  **  \n                
0000034
Hexdump of СМП структура:
0000000    d0  a1  d0  9c  d0  9f  20  d1  81  d1  82  d1  80  d1  83  d0
           С   **  М   **  П   **      с  **   т  **   р  **   у  **   к
0000020    ba  d1  82  d1  83  d1  80  d0  b0  0a                        
           **  т   **  у   **  р   **  а   **  \n                        
0000032
Asked by jsx97 (1347 rep)
Mar 14, 2025, 03:58 PM
Last activity: Mar 16, 2025, 06:00 PM