Shayan Tahir
Shayan Tahir

Reputation: 1

Write urdu in notepad file using matlab

I have a Urdu Optical character Recognition. When I convert my image text to Unicode and write it in notepad file it shows like "ÌÇ Ûã ˜Ç äíÇ ÝÑ " not in urdu language. Here is my code

disp(native2unicode(rst))
f = fopen('temp.txt', 'w', 'native', 'UTF-8');
s = char(native2unicode(rst));
fprintf(f, ' %s.\r\n', s);
fclose(f);

Upvotes: 0

Views: 113

Answers (1)

X Zhang
X Zhang

Reputation: 1325

The following code runs fine on my system. Maybe the added 'UTF-8' parameter helped?

rst='اردو‎';
disp(native2unicode(rst,'UTF-8'))
s = char(native2unicode(rst,'UTF-8'));
f = fopen('temp.txt', 'w', 'native', 'UTF-8');
fprintf(f, ' %s.\r\n', s);
fclose(f);

enter image description here

Upvotes: 1

Related Questions