New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buggy support for Chinese characters #2536
Comments
Thanks your feedback! What is your Gogs version and can you reproduce this on https://try.gogs.io? |
我用的版本是 © 2015 Gogs 当前版本: 0.8.10.1217 测试的库已经上传到https://try.gogs.io/cztest/test1.git 测试方法是先用TortoiseHg 3.62版建立hg库。 try.gogs.io中的库没有因为中文文件名或路径名出现500错,可能是升级解决了此问题。 另外,首页预览中的Readme.Txt中的中文仍旧是乱码。 通过git提交到gogs库里可以正确处理中文路径名。 如果通过hg-git再次拉到hg库里,这个"中文目录"是乱码。 看来多半是hg-git对中文路径名处理错误,造成上传和下载中文路径名或文件名乱码。 |
Thanks... You may want to set a good value for this config option. |
https://try.gogs.io/cztest/test1/raw/master/main.c 中的中文显示是乱码的,下载后文件没问题 这说明不同后缀预览处理不一致。 |
Thanks... but I don't see any valuable points here. And, please do not skip my comments. |
app.ini中设置了 浏览原来有500错的库,问题依旧。 再次使用TortoiseHg 提交到一个新的库,问题还是存在。 可能升级到与try.gogs.io相同的版本能解决,但这需要编译,我再试试。 提交到https://github.com/Strongc/test222.git的库 |
What is the error log for 500? |
就是显示个大大的500。 在try.gogs.io上没有这个问题。 |
Please check log on the server side. |
错误都是类似这样: [...routers/repo/view.go:134 Home()] [E] GetCommitsInfo: GetCommitByPath (doc//说明 2.docx): Length must be 40: |
我还没有go环境,对go,git也不熟悉,尝试着搜索了一番,感觉好像是这里出错了。 https://github.com/gogits/git-module/blob/d86a90f801dbe279db095437a8c7ea42c60e8d98/tree.go step = 40 |
https://try.gogs.io/cztest/test2/src/master/doc 使用谷歌浏览器,更多工具,编码,选择GB18030,则路径中的中文文件名正确显示。 https://try.gogs.io/cztest/test2/src/master/main.c 说明gogs对这两种文件使用了不同的处理方式 |
What is the real encoding of this file? |
看起来应该是GB18030,就是普通的中文win10下用记事本做的文件 |
You must be sure... |
这是一个查内码,提供乱码恢复的网站 这是自动检测GB18030和UTF8的例子 现在显示乱码就是在中文win10环境下生成的中文编码是GB18030,在网页预览时,被识别为Windows-1252,因此显示为乱码。但强行设置网页编码为GB18030也无效,原因不清楚。 但Readme.txt在首页预览中的中文可以正确显示,这个又是怎么回事? https://try.gogs.io/cztest/test2/src/master/doc |
原始的文件 main.c.txt |
Thanks for the details but I'm sorry I have no idea about what you're trying to say...
Would you be able to reproduce this 500 on https://try.gogs.io ? |
|
@0maxxam0 has funded $10.00 to this issue. See it on IssueHunt |
I also encountered this problem. The version of gogs on my server was upgraded from 0.12.3 to 0.12.10. When the name of the file I uploaded to the git version is Chinese, 500 errors will appear on the page, But I'm https://try.gogs.io There is no problem trying, Then I found a new server to install the 0.12.10 gogs directly, and found that there would be no such problem. So I upgraded the git version on the server from 1.8.3.1 to 2.38.1, and then I found that the problem has been solved. |
Amazing discovery, thank you! @cyfx |
1.从hggit导入的库,如果目录里有中文名的文件,试图打开这个目录,则报500错误
如果在根目录有中文名目录或者有中文名文件,仓库首页报500
https://pypi.python.org/pypi/hg-git (hggit 0.84版)
TortoiseHg 3.62版
Gogs使用数据库是Sqlite,win8主机
客户端是谷歌浏览器,Win10
经测试,报500错的,也可以克隆出来。
但中文名的文件或目录已经是乱码了。
2.在仓库首页,Readme.txt文件中的中文都是乱码。
经过比较,发现commit里的中文是utf-8,而文件中的是gbk或18030
3.浏览文件,文件中的中文注释是乱码,尝试使用gbk,18030等编码也无法正确显示。
但克隆出来的文件中中文仍是正确的。
4.不支持中文仓库名,而bitbucket.org是支持的
The text was updated successfully, but these errors were encountered: