1,首先是下载下面的转码数组,将EBU编码转换为Unicode数字编码

  https://files.cnblogs.com/files/senior-engineer/EBU%E7%BC%96%E7%A0%81_European_Broadcasting_Union.rar

2,然后调用下面的数组将Unicode数字编码转换为Unicode字符串。

QString getEBUToUnicode(const char *data, const ushort length)
{
    ushort sName = 0;
    QString strName;
    for(int j = 0; j < length ; j++)
    {
        sName = ebuLatinToUcs2[data[j]];
        strName += QChar(sName);
    }
}

3,因为QT默认使用的是Unicode的编码,将对应字符串显示就可以了。

 

说明:验证显示的Unicode编码是否正确

    unsigned short strName[16] = {78,82,75,32,80,\
                                  49,32,216,115,116,\
                                  102,111,108,100,32,32};

将上面输出的数字转换为下面的格式

\u004E\u0052\u004B\u0020\u0050\u0031\u0020\u00D8\u0073\u0074\u0066\u006F\u006C\u0064\u0020\u0020

然后对应字符输入下面网站中,对照控件上面显示的字符和网站上面显示字符是否一致。注意不要通过打印验证,因为有些特殊字符打印是显示不出来的。

http://tool.chinaz.com/tools/unicode.aspx

相关文章:

  • 2021-05-23
  • 2021-06-11
  • 2021-07-04
  • 2021-06-21
  • 2022-12-23
  • 2021-11-20
  • 2021-07-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案