2

I have a text file which contains unicode persian text (Arabic units).
My system crashed and after reboot I found my file corrupted.
the file currently displays text like this:

гУКдП ПСИЗСе Мдђ жнКдЗг ж ВгСнЗУК
гХЗНИе еЗн ВСФнжн КжФ геге
ПЮнЮе 3:27 Ун е ПЗСе дФжд гнПе ЗУгФ едСн УндМС ЗПг Онбн гегн е Кжн ВСФнж ЭжбПС Ие ЗУгФ ПЗСнг ИЪП ЗТ Знд ЛЗдне гнТде КХЗнС МПнП УндМС е ПЗСе ХНИК гнде ЗждЗ Сж ег ИђнС
ЗПгн е ЗТ 5:28 дФжд гнПе ЗУгФ ђСЗеЗг гЗСКнд УЭнС ВгСнЗ ПС жнКдЗг МджИн КХЗжнСФ Сж ИђнС
Ун е ПЮнЮе 16:48 ПЗСе ХНИК гнде МСЗбП ЭжСП СЖнУ МгежС ВгСнЗУК НжЗУК Ие КХЗжнСФ ИЗФе еге Сж ИђнС
ЪУ еЗн КжФ геге
гХЗНИе еЗн МПнП Сж дгнОжЗнг

the clocks are correct ! so 3:27 and 5:28 and 16:48 and space characters are displayed correctly but the rest of text is corrupted.
I used a hex editor and checked unicode units:

EF BB BF D0 B3 D0 A3 D0 9A D0 B4 D0 9F 20 D0 9F D0 A1 D0 98 D0 97 D0 A1 D0 B5 20 D0 9C D0 B4 D1 92 20 D0 B6 D0 BD D0 9A D0 B4 D0 97 D0 B3 20 D0 B6 20 D0 92 D0 B3 D0 A1 D0 BD C2 98 D0 97 D0 A3 D0 9A 0D 0A D0 B3 D0 A5 D0 97 D0 9D D0 98 D0 B5 20 D0 B5 D0 97 D0 BD 20 D0 92 D0 A1 D0 A4 D0 BD D0 B6 D0 BD 20 D0 9A D0 B6 D0 A4 20 D0 B3 D0 B5 D0 B3 D0 B5 0D 0A D0 9F D0 AE D0 BD D0 AE D0 B5 20 33 3A 32 37 20 C2 98 D0 A3 D0 BD 20 C2 98 D0 B5 20 D0 9F D0 97 D0 A1 D0 B5 20 D0 B4 D0 A4 D0 B6 D0 B4 20 D0 B3 D0 BD D0 9F D0 B5 20 D0 97 D0 A3 D0 B3 D0 A4 20 D0 B5 D0 B4 D0 A1 D0 BD 20 C2 98 D0 A3 D0 BD D0 B4 D0 9C D0 A1 20 D0 97 D0 9F D0 B3 20 D0 9E D0 BD D0 B1 D0 BD 20 D0 B3 D0 B5 D0 B3 D0 BD 20 C2 98 D0 B5 20 D0 9A D0 B6 D0 BD 20 D0 92 D0 A1 D0 A4 D0 BD D0 B6 20 D0 AD D0 B6 D0 B1 D0 9F D0 A1 20 D0 98 D0 B5 20 D0 97 D0 A3 D0 B3 D0 A4 20 D0 9F D0 97 D0 A1 D0 BD D0 B3 20 D0 98 D0 AA D0 9F 20 D0 97 D0 A2 20 D0 97 D0 BD D0 B4 20 D0 9B D0 97 D0 B4 D0 BD D0 B5 20 D0 B3 D0 BD D0 A2 D0 B4 D0 B5 20 D0 9A D0 A5 D0 97 D0 BD D0 A1 20 D0 9C D0 9F D0 BD D0 9F 20 C2 98 D0 A3 D0 BD D0 B4 D0 9C D0 A1 20 C2 98 D0 B5 20 D0 9F D0 97 D0 A1 D0 B5 20 D0 A5 D0 9D D0 98 D0 9A 20 D0 B3 D0 BD C2 98 D0 B4 D0 B5 20 D0 97 D0 B6 D0 B4 D0 97 20 D0 A1 D0 B6 20 D0 B5 D0 B3 20 D0 98 D1 92 D0 BD D0 A1 0D 0A D0 97 D0 9F D0 B3 D0 BD 20 C2 98 D0 B5 20 D0 97 D0 A2 20 35 3A 32 38 20 D0 B4 D0 A4 D0 B6 D0 B4 20 D0 B3 D0 BD D0 9F D0 B5 20 D0 97 D0 A3 D0 B3 D0 A4 20 D1 92 D0 A1 D0 97 D0 B5 D0 97 D0 B3 20 D0 B3 D0 97 D0 A1 D0 9A D0 BD D0 B4 20 D0 A3 D0 AD D0 BD D0 A1 20 D0 92 D0 B3 D0 A1 D0 BD C2 98 D0 97 20 D0 9F D0 A1 20 D0 B6 D0 BD D0 9A D0 B4 D0 97 D0 B3 20 D0 9C D0 B4 D0 B6 D0 98 D0 BD 20 D0 9A D0 A5 D0 97 D0 B6 D0 BD D0 A1 D0 A4 20 D0 A1 D0 B6 20 D0 98 D1 92 D0 BD D0 A1 0D 0A C2 98 D0 A3 D0 BD 20 C2 98 D0 B5 20 D0 9F D0 AE D0 BD D0 AE D0 B5 20 31 36 3A 34 38 20 D0 9F D0 97 D0 A1 D0 B5 20 D0 A5 D0 9D D0 98 D0 9A 20 D0 B3 D0 BD C2 98 D0 B4 D0 B5 20 D0 9C D0 A1 D0 97 D0 B1 D0 9F 20 D0 AD D0 B6 D0 A1 D0 9F 20 D0 A1 D0 96 D0 BD D0 A3 20 D0 9C D0 B3 D0 B5 D0 B6 D0 A1 20 D0 92 D0 B3 D0 A1 D0 BD C2 98 D0 97 D0 A3 D0 9A 20 D0 9D D0 B6 D0 97 D0 A3 D0 9A 20 D0 98 D0 B5 20 D0 9A D0 A5 D0 97 D0 B6 D0 BD D0 A1 D0 A4 20 D0 98 D0 97 D0 A4 D0 B5 20 D0 B5 D0 B3 D0 B5 20 D0 A1 D0 B6 20 D0 98 D1 92 D0 BD D0 A1 0D 0A D0 AA C2 98 D0 A3 20 D0 B5 D0 97 D0 BD 20 D0 9A D0 B6 D0 A4 20 D0 B3 D0 B5 D0 B3 D0 B5 0D 0A D0 B3 D0 A5 D0 97 D0 9D D0 98 D0 B5 20 D0 B5 D0 97 D0 BD 20 D0 9C D0 9F D0 BD D0 9F 20 D0 A1 D0 B6 20 D0 B4 D0 B3 D0 BD D0 9E D0 B6 D0 97 D0 BD D0 B3

but it doesnt seem match any unicode char in persian (which start from d880 to dbbf or code points from 0600 to 06ff) while space (unit 20) and latin numbers are correct!

is there any way to fix this text?

2

It looks like it has perhaps been read using the wrong encoding (KO18?) causing the Persian code-point values to be read as Cyrillic and then saved using the UTF8 encoding for Cyrillic,

EF BB BF   - Byte Order Mark 0xFEFF in UTF-8 encoding


D0 B3   - Common Cyrillic characters in UTF8 start with D0, D1 or D2
D0 A3 
D0 9A 
D0 B4 
D0 9F 
20      - Space character
D0 9F 
D0 A1 
D0 98 
D0 97 

If you know what the Arabic characters were for the first few words, you may be able to deduce a numeric transformation needed to reverse the incorrect re-encoding. Not all transformations are reversible of course.

I don't read Arabic/Persian so I've no idea what transformations result in sensible text.

For example changing the D0s to D8 changes

гУКдП ПСИЗСе

to

سأؚش؟ ؟ءؘؗءص

Which Google translates to

I'll be back? What?

But I've no idea whether that is nonsense. It certainly looks like nonsense.

Some time spent playing about in a similar fashion may lead to a solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.