Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÏÂʹÓÃQt±à³ÌÖÐÎÄÂÒÂëµÄ½â¾ö


ÔÚQTÖпÉÒÔÖ±½ÓʹÓÃQTextCodecÀ´×ª»»×Ö·û´®µÄ±àÂë¡£
ÀýÈ磬ÎÒÃÇÏëÔÚ³ÌÐòÖÐʹÓÃÖÐÎÄ£¬ÀàËÆtr£¨“飬ÄãºÃÂ𣿔£©¡£ÎÒÃÇÒªÔÚmainº¯ÊýÖÐÔö¼ÓÒÔϼ¸ÌõÓï¾ä£¬ÖØÐÂÉèÖÃÒ»ÏÂĬÈϵıàÂëÆ÷¡£
Ïȵ÷ÓÃÏÂÃæÁ½¸öº¯ÊýÖ®Ò»
QTextCodec *codec=QTextCodec::codecForName(”gbk”);
QTextCodec *codec=QTextCodec::codecForName(”utf8″);
È»ºóµ÷ÓÃÏÂÃæÈý¸öº¯ÊýÖ®Ò»
QTextCodec::setCodecForCStrings(codec);
//Õâ¸öº¯ÊýÖ÷ÒªÊÇÓÃÔÚ×Ö·û³£Á¿»òÕßQByteArray¹¹ÔìQString¶ÔÏóʱʹÓõÄÒ»ÖÖ±àÂ뷽ʽ¡£
QTextCodec::setCodecForTr(codec);
//Õâ¸öº¯ÊýµÄ×÷ÓÃÊÇÉèÖô«¸øtrº¯ÊýʱµÄĬÈÏ×Ö·û´®±àÂ룬GUIÉè¼ÆÖÐ×î³£ÓõÄÒ»ÖÖ¡£
QTextCodec::setCodecForLocale(codec);
//Õâ¸öº¯ÊýÖ÷ÒªÓÃÓÚÉèÖúͶԱ¾µØÎļþϵͳ¶ÁдʱºòµÄĬÈϱàÂë¸ñʽ¡£±ÈÈçͨ¹ýÁ÷¶ÁÈ¡Ò»¸öÎļþÄÚÈÝʱµÄ±àÂë¸ñʽ¡£»òÕßͨ¹ýqDebug£¨£©Êä³ö´òÓ¡ÐÅϢʱµÄ±àÂë¡£
ʾÀýÈçÏ£º
ÔÚºìñ×ÓÆóÒµ°ælinux5ÉÏÔËÐÐQtCreator±àдÈçϳÌÐò
#include <QApplication>
#include <QTextCodec>
#include <QWidget>
#include <QLabel>
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QTextCodec::setCodecForTr(QTextCodec::codecForName("gb18030"));//********
    QWidget *pWidget = new QWidget;
    QLabel label(pWidget);
    label.setText(QObject::tr("ͬһ¸öÊÀ½ç£¬Í¬Ò»¸öÃÎÏë"));
    pWidget->show();
    return app.exec();
}
ÔËÐÐÏÔʾÂÒÂ룬½«gb8030¸ÄΪutf8£¬ÔòÕýÈ·ÏÔʾÖÐÎÄ¡£


Ïà¹ØÎĵµ£º

Linux c++






Linux/UNIX C++¸ß¼¶Åàѵ---Ô¶³Ì°à
http://www.xuanyuan-soft.cn/index.php?option=com_content&view=article&id=84&Itemid=85
¿Î³Ì¸ÅÒª
 
ÅàÑøÄ¿±ê
£ºLinux/UNIX C++Èí¼þ¹¤³Ìʦ
רעLinux/UNIX·þÎñÆ÷¶ËµÄÈí¼þ¿ª·¢£¨ºǫ́¿ª·¢£©£¬ÅàÑøÆóÒµËùÐèµÄרҵLinux/UNIX C ......

ÔÚLinuxϱàдDaemon

ÔÚLinuxϱàдDaemon
 
ÔÚLinux£¨ÒÔRedhat Linux Enterprise Edition 5.3ΪÀý£©Ï£¬ÓÐʱÐèÒª±àдService¡£ServiceÒ²ÊdzÌÐò£¬Ò»°ãËæϵͳÆô¶¯Óû§²»¸ÉÔ¤¾Í²»Í˳öµÄ³ÌÐò£¬¿ÉÒÔ³ÆΪService¡£LinuxϵÄServiceÒ»°ã³ÆΪDaemon¡£
 
ÒÔÉÏÊǹãÒåµÄServiceµÄ¶¨Òå¡£LinuxϵķþÎñÒ»°ã·ÅÔÚ/etc/init.dÎļþ¼ÐÏ¡£ä¯ÀÀÒ»ÏÂÕ ......

Linux²Ù×÷ϵͳÏÂÒÔÌ«Íø¿¨µÄ°²×°¼°ÅäÖÃ

Linux²Ù×÷ϵͳÏÂÒÔÌ«Íø¿¨µÄ°²×°¼°ÅäÖÃ
¡¾ÍøѶÍøÂçͨÐÅѧԺ¡¿
    Linux²Ù×÷ϵͳÒÔÆä¶ÀÓеĿª·ÅÐÔ¡¢Îȶ¨ÐÔ¡¢¸ßЧÂʵÈÌص㣬Êܵ½Ô½À´Ô½¶àÓÐʶ֮ʿµÄÇàíù¡£Ëæ×ÅIT²úÒµ¾ÞÍ··×·×Ðû²¼¶ÔLinuxµÄÖ§³Ö£¬LinuxÕýÔÚѸËÙÀ©Õ¹ÆäÓ¦ÓÃÊг¡£¬ÌرðÊÇ·þÎñÆ÷Êг¡¡£ÔÚ±ê×¼ÉÏ£¬LinuxÓëPOSIX1003.1¼æÈÝ£¬µ«Ëü¾ßÓбÈÒÔסµÄUNIXÏµÍ ......

ÊÖ¶¯ÅäÖÃlinuxµÄIPµØÖ·

 linuxµÄÍø¿¨IPµØÖ·ÊÇ´æ·ÅÔÚÎĵµÖеģ¬Õâ¸öÅäÖÃÎĵµÔÚ/etc/sysconfig/network-scriptsÏ£¬Ãû³Æ·Ö±ðΪifcfg-eth0,ifcfg-eth1....¼ÙÈçÄúÓÐÒ»¿éÍø¿¨£¬¾ÍÖ»ÓÐifcfg-eth0Ò»¸öÎĵµ£¬¼ÙÈçÄúÓÐÁ½¿é»òÁ½¿éÒÔÉϵÄÍø¿¨£¬¾Í»áÓÐifcfg-eth1¡¢ifcfg-eth2µÈÎĵµµÄ³öÏÖ¡£
Îĵµ½á¹¹£º
DEVICE=eth0        &n ......

linux Ͻâ¾ö google music ÂÒÂë

ÊäÈëÃüÁ
sudo gedit /etc/fonts/conf.d/49-sansserif.conf
Ô­ÎĵÄÄÚÈÝÊÇ£º
Html´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://kmplayer.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://kmplayer.javaeye.com/javascripts/syntaxhighlighter/clipboar ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ