Author Topic: Japanese  (Read 3081 times)

kybu

  • Newbie
  • *
  • Posts: 2
    • View Profile
Japanese
« on: March 14, 2004, 03:11:11 am »
Hi,

I would like to save japanese character in utf8 encoding to file on the japanese models of Zaurus, but I have no idea how to achieve this. I suppose that I need to convert QStrings data (input from user) to utf8, but how can I determine the encoding of that QString? Thanks.

torhans

  • Newbie
  • *
  • Posts: 2
    • View Profile
Japanese
« Reply #1 on: January 09, 2005, 03:37:04 am »
Hi

I'm successfully using the following, but there might be a better way.


#include <qtextstream.h>
#include <qstring.h>
...
FILE* writeFile;
QString strJapanese;
...
QTextStream outstream(writeFile,IO_WriteOnly);
outstream.setEncoding(QTextStream::UnicodeUTF8);
outstream  << strJapanese << endl;
...

The encoding of the QString in handled internally and you need not to concern youself about it.

Regards
Torben