how do I get default encoding safely/normaly.

Michael Pyne michael.pyne at kdemail.net
Tue Dec 20 05:45:23 CET 2005


On Monday 19 December 2005 07:31, tomohiko kitamura wrote:
> hi all,help us.
> how do I get default char-set (Japan/ja)/ code assign in KDE
> normaly in Linux OS?
> I using SuSE Linux10 + KDE environment3.4 and
> java J2SE5.0+netbeans4.1/5.0 beta2.
> the source code of I written that with Shift-JIS-code,
> but KDE assign EUC-JP code and UTF-8 .
> (assign Shift-JIS > encode error)
> (and UTF-8 including EUC-JP coding)

You can use the KLocale class, which can be accessed through KGlobal.

KLocale::encoding() and KLocale::codecForEncoding() may be useful as well.

// code

QString localeName()
{
  KLocale *locale = KGlobal::locale();
  QString encodingName = locale->encoding();

  return encodingName;
}

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-quality/attachments/20051220/e36e4a04/attachment.pgp


More information about the kde-quality mailing list