【问题标题】:Write urdu in notepad file using matlab使用matlab在记事本文件中写入urdu
【发布时间】:2022-01-04 02:12:42
【问题描述】:

我有一个乌尔都语光学字符识别。当我将图像文本转换为 Unicode 并将其写入记事本文件时,它显示为“ÌÇ Ûã ∼Ç äíÇ ÝÑ”,而不是乌尔都语。这是我的代码

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

【问题讨论】:

  • 我认为记事本默认不识别 UTF-8。

标签: matlab unicode utf-8


【解决方案1】:

以下代码在我的系统上运行良好。也许添加的“UTF-8”参数有帮助?

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);

【讨论】:

    猜你喜欢
    • 2012-02-24
    • 2011-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-04
    • 1970-01-01
    • 1970-01-01
    • 2017-07-23
    相关资源
    最近更新 更多