Exemplo n.º 1
0
UNICHAR_ID wc_to_unichar_id(const UNICHARSET &unicharset, int wc) {
  UNICHAR uch(wc);
  char *unichar = uch.utf8_str();
  UNICHAR_ID unichar_id = unicharset.unichar_to_id(unichar);
  delete[] unichar;
  return unichar_id;
}
Exemplo n.º 2
0
bool psdread_unicodestring(QIODevice *io, QString &s)
{
    quint32 stringlen;
    if (!psdread(io, &stringlen)) {
        return false;
    }

    for (uint i = 0; i < stringlen; ++i) {
        quint16 ch;
        if (!psdread(io, &ch)) {
            return false;
        }

        if (ch != 0) {
            QChar uch(ch);
            s.append(uch);
        }
    }

    return true;
}