Ubuntu Qt5.13 无法输入中文和中文显示乱码问题

无法输入中文:

sudo apt-get install libfcitx-qt5-dev

cd /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/

sudo cp libfcitxplatforminputcontextplugin.so  /opt/Qt5.13.0/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/
sudo cp libfcitxplatforminputcontextplugin.so  /opt/Qt5.13.0/5.13.0/gcc_64/plugins/platforminputcontexts/

中文乱码问题

在main.cpp中添加头文件:

#include <QTextCodec>

QApplication a(argc, argv);后添加两行代码

QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));

原文地址:https://www.cnblogs.com/raina/p/11315681.html

时间: 2024-08-27 21:36:46

Ubuntu Qt5.13 无法输入中文和中文显示乱码问题的相关文章

ubuntu 中用vim打开txt等文件中文显示乱码的解决方法 &nbsp;

今晚用ubuntu 12.04 的vim编辑网页代码时,发现上面的中文显示乱码.这个html文件是我之前用gedit编辑的,在gedit里面显示正常,可是在vim下显示就是乱码了. 怎么解决ubuntu中vim显示中文乱码的问题呢? 首先,添加中文字符编码: sudo gedit /var/lib/locales/supported.d/local 在打开的文件中添加下面的中文字符集 zh_CN.GBK GBK zh_CN.GB2312 GB2312 zh_CN.GB18030 GB18030

jmeter察看结果树—响应数据中的中文显示乱码的问题

jmeter察看结果树-响应数据中的中文显示乱码的问题: 打开文件:jmeter\bin\jmeter.properties 原始内容: 默认编码为:ISO-8859-1 # The encoding to be used if none is provided (default ISO-8859-1) #sampleresult.default.encoding=ISO-8859-1 修改为: sampleresult.default.encoding=utf-8 修改配置后,要重启jmete

ORACLE 11G中PLSQL中文显示乱码、Linux下sqlplus查询中文乱码

问题描述: 本地是win7操作系统,cmd里面sqlplus进去连接oracle数据库,中文可以正常显示,但是plsql连接oracle数据库,中文显示乱码,还有xshell远程连接oracle服务器登录进去使用sqlplus登录也显示中文乱码. 1.检查windows7下面cmd里面sqlplus中oracle server端的字符集. 打开cmd,用sqlplus登录,输入下面SQL查询服务端的字符集. SQL> select userenv('language') fromdual; US

Servlet内容中的中文显示乱码问题

一.常识了解 1.GBK包含GB2312,即如果通过GB2312编码后可以通过GBK解码,反之可能不成立; 2.java.nio.charset.Charset.defaultCharset() 获得平台默认字符编码: 3.getBytes() 是通过平台默认字符集进行编码: 二.中文乱码出现 在学习任何一门技术时,经常会有初学者遇到中文乱码问题,比如MySQL,是因为在安装时没有设置:而在Servlet中,也会遇到中文乱码问题: 比如: OutputStream out = response.

linux中vim中文显示乱码

这里所说的都是全局设定,打开vimrc文件后,只需要在文件最后添加以下代码就可以了: set fileencodings=utf-8,gb2312,gbk,gb18030 set termencoding=utf-8 set fileformats=unix set encoding=prc 这样,你的vim中文乱码问题就解决了!

centos终端中mysql中文显示乱码的处理

http://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf-8-in-my-cnfhttps://dev.mysql.com/doc/refman/5.0/en/charset-configuration.html 编辑 /etc/my.conf文件,增加以下内容 [client] default-character-set=utf8 [mysql] default-character-

JS-只能输入中文和英文

<span style="font-family:KaiTi_GB2312;">转自:<a target=_blank href="http://www.cnblogs.com/liupeizhi/articles/2487472.html">http://www.cnblogs.com/liupeizhi/articles/2487472.html</a></span> </pre><pre nam

解决“在UBUNTU下打开windows中创建的文本文件,中文显示乱码”的问题 。

在UBUNTU下打开windows中用notepad等工具创建的txt或程序源码等文本文件,中文显示乱码,原因是windows中的txt文件编码方式为GBK,UBUNTU中为utf-8. 解决办法:在终端中使用iconv命令对此文本文件进行转码,使用方法如图所示.具体到我的写法:iconv -f gbk -t utf-8 text.txt -o text.txt.utf8

ubuntu 中文显示乱码问题 (转)

添加中文字符编码: $sudo vim /var/lib/locales/supported.d/local #添加下面的中文字符集 zh_CN.GBK GBK zh_CN.GB2312 GB2312 zh_CN.GB18030 GB18030 使其生效: $sudo dpkg-reconfigure locales vim: 打开vim的配置文件,位置在/etc/vim/vimrc 在其中加入 set fileencodings=utf-8,gb2312,gbk,gb18030 set ter