开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 1.4K

javaalpha/DocSys

forked from Rainy/DocSys
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (2)
标签 (164)
master
devInt
DocSys_V2.02.36
DocSys_V2.02.35
DocSys_V2.02.34
DocSys_V2.02.33
DocSys_V2.02.32
DocSys_V2.02.31
DocSys_V2.02.30
DocSys_V2.02.29
DocSys_V2.02.28
DocSys_V2.02.27
DocSys_V2.02.26
DocSys_V2.02.25
DocSys_V2.02.24
DocSys_V2.02.23
DocSys_V2.02.22
DocSys_V2.02.21
DocSys_V2.02.20
DocSys_V2.02.19
DocSys_V2.02.18
DocSys_V2.02.17
master
分支 (2)
标签 (164)
master
devInt
DocSys_V2.02.36
DocSys_V2.02.35
DocSys_V2.02.34
DocSys_V2.02.33
DocSys_V2.02.32
DocSys_V2.02.31
DocSys_V2.02.30
DocSys_V2.02.29
DocSys_V2.02.28
DocSys_V2.02.27
DocSys_V2.02.26
DocSys_V2.02.25
DocSys_V2.02.24
DocSys_V2.02.23
DocSys_V2.02.22
DocSys_V2.02.21
DocSys_V2.02.20
DocSys_V2.02.19
DocSys_V2.02.18
DocSys_V2.02.17
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (2)
标签 (164)
master
devInt
DocSys_V2.02.36
DocSys_V2.02.35
DocSys_V2.02.34
DocSys_V2.02.33
DocSys_V2.02.32
DocSys_V2.02.31
DocSys_V2.02.30
DocSys_V2.02.29
DocSys_V2.02.28
DocSys_V2.02.27
DocSys_V2.02.26
DocSys_V2.02.25
DocSys_V2.02.24
DocSys_V2.02.23
DocSys_V2.02.22
DocSys_V2.02.21
DocSys_V2.02.20
DocSys_V2.02.19
DocSys_V2.02.18
DocSys_V2.02.17
DocSys
/
src
/
com
/
DocSystem
/
test
/
CharsetTest.java
DocSys
/
src
/
com
/
DocSystem
/
test
/
CharsetTest.java
CharsetTest.java 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
13777479349 提交于 2020年05月21日 10:09 +08:00 . 增加字符编码转换测试
package com.DocSystem.test;
class CharsetTest
{
public static void main(String[] args)
{
System.out.println("This is test app");
String str = "便签";
String utf8_str = "";
String gbk_str = "";
String gb2312_str = "";
String iso8859_str = "";
String asc_str = "";
String utf16_str = "";
String gb18030_str = "";
//注意:字符编码转换之后未必你能转换回来,比如将中文转成ascii码会丢信息,所以将无法还原,这里的测试对于ascii和iso8859会出现乱码问题
try {
//将中文字符串按指定格式转成字节流
byte[] buff = str.getBytes();
byte[] utf8_buff = str.getBytes("UTF-8");
byte[] gbk_buff = str.getBytes("GBK");
byte[] gb2312_buff = str.getBytes("GB2312");
byte[] iso8859_buff = str.getBytes("ISO-8859-1");
byte[] asc_buff = str.getBytes("ASCII");
byte[] utf16_buff = str.getBytes("UTF-16");
byte[] gb18030_buff = str.getBytes("GB18030");
//将字节流按默认格式转成字符串
str = new String(buff);
utf8_str = new String(utf8_buff);
gbk_str = new String(gbk_buff);
gb2312_str = new String(gb2312_buff);
iso8859_str = new String(iso8859_buff);
asc_str = new String(asc_buff);
utf16_str = new String(utf16_buff);
gb18030_str = new String(gb18030_buff);
System.out.println("str:" + str);
System.out.println("utf8_str:" + utf8_str);
System.out.println("gbk_str:" + gbk_str);
System.out.println("gb2312_str:" + gb2312_str);
System.out.println("iso8859_str:" + iso8859_str);
System.out.println("asc_str:" + asc_str);
System.out.println("utf16_str:" + utf16_str);
System.out.println("gb18030_str:" + gb18030_str);
//将字节流按对应格式转成字符串
str = new String(buff);
utf8_str = new String(utf8_buff, "UTF-8");
gbk_str = new String(gbk_buff, "GBK");
gb2312_str = new String(gb2312_buff, "GB2312");
iso8859_str = new String(iso8859_buff, "ISO-8859-1");
asc_str = new String(asc_buff, "ASCII");
utf16_str = new String(utf16_buff, "UTF-16");
gb18030_str = new String(gb18030_buff, "GB18030");
System.out.println("str:" + str);
System.out.println("utf8_str:" + utf8_str);
System.out.println("gbk_str:" + gbk_str);
System.out.println("gb2312_str:" + gb2312_str);
System.out.println("iso8859_str:" + iso8859_str);
System.out.println("asc_str:" + asc_str);
System.out.println("utf16_str:" + utf16_str);
System.out.println("gb18030_str:" + gb18030_str);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

MxsDoc是基于Web的文件管理系统,支持权限管理、历史版本管理、Office预览/编辑、WPS预览/编辑、在线解压缩、文件分享、文件加密、远程存储、远程文件推送、秒传、断点续传、智能搜索、文件备注、自动备份、一键迁移。 主要应用场景:文件管理系统、协同办公系统、电子书、知识管理系统、软件接口管理系统、自动备份软件、网页版SVN仓库、网页版GIT仓库。GPL 2.0开源协议.
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/javaalpha/DocSys.git
git@gitee.com:javaalpha/DocSys.git
javaalpha
DocSys
DocSys
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /