在Ubuntu中用gedit打开一个文件,其中有中文注释,但是中文部分显示乱码。网上查找了很多方法,其中一种是用gconf-editor来处理,但是我打开gconf-editor,其中的apps选项中除了gconf-editor这一个之外没有任何其他的程序,我不知道为什么,也没有细究下去。 另一种解 ...
分类:
系统相关 时间:
2020-06-07 12:35:27
阅读次数:
74
原因:ubuntu上没有默认使用zh_HK.UTF-8字符集,默认使用en_HK.UTF-8,导致不支持中文字符 解决办法:设定默认locale为中文UTF-81:打开locale文件 gedit /etc/default/locale 2: 修改配置为如下 LANG="zh_HK.UTF-8" L ...
分类:
系统相关 时间:
2020-06-05 00:57:21
阅读次数:
106
今天使用 qt 的写入文件,发现中文乱码,经过一番查找,解决问题。 QTextStream txt(&file); txt.setCodec(QTextCodec::codecForName("utf-8")); txt << QString::fromStdString(json.toFormat ...
分类:
其他好文 时间:
2020-06-04 19:52:37
阅读次数:
60
request.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=utf-8"); <%@ page contentType="text/html;charset=UTF-8" language="ja ...
分类:
其他好文 时间:
2020-06-03 14:04:20
阅读次数:
51
#解决中文显示乱码问题 plt.rcParams['font.sans-serif'] = ['KaiTi'] # 指定默认字体,设置为中文字体# plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题 ...
分类:
编程语言 时间:
2020-06-03 11:56:50
阅读次数:
83
url上的中文字符是ISO-8859-1。后台获取中文乱码解决问题。 需要转码 public static String changeCharset(String str, String defaultValue) { if (str != null) { try { if ((StringUtil ...
分类:
Web程序 时间:
2020-06-02 18:50:56
阅读次数:
116
package { import flash.display.Sprite; import flash.events.Event; import flash.filesystem.File; import flash.filesystem.FileMode; import flash.filesys ...
分类:
其他好文 时间:
2020-06-02 16:11:08
阅读次数:
82
$result = [1,2,'a','中国','USA']; $res = json_encode($result, JSON_UNESCAPED_UNICODE); // 转为JSON字符串 JSON_UNESCAPED_UNICODE :防止中文乱码 var_dump($res); var_d ...
分类:
Web程序 时间:
2020-06-02 10:56:25
阅读次数:
73
设置IP地址为动态获取 netsh interface ip set address name="本地连接" source=dhcp 配置静态IP的命令 netsh interface ip set address name="本地连接" source=static addr=192.168.36. ...
(二)登录功能实现 1. 编写前端页面 若jsp页面中文乱码:在jsp中指定页面显示的编码为GBK 添加page命令 <%@ page language="java" contentType="text/html; charset=GBK" %> 参考:https://www.cnblogs.com ...
分类:
Web程序 时间:
2020-05-31 21:58:36
阅读次数:
135