HelloZeroNet / ZeroNet

ZeroNet - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.io
Other
18.37k stars 2.27k forks source link

Server error,Support for file name i18n is not user-friendly.. #718

Closed cxgreat2014 closed 7 years ago

cxgreat2014 commented 7 years ago

url: http://127.0.0.1:43110/site_address/songs/%E5%A4%AA%E4%B8%8A%E8%80%81%E5%90%9B%E8%AF%B4%E6%B8%85%E9%9D%99%E7%BB%8F.mp3

Err: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 6: ordinal not in range(128) in UiServer.py line 81 > UiRequest.py line 82 > UiRequest.py line 190 > UiRequestPlugin.py line 22 > TranslateSitePlugin.py line 24 > UiRequest.py line 367 > Site.py line 629 > SiteStorage.py line 262 > SiteStorage.py line 278

Please report it if you think this an error.

Details:

{ "GATEWAY_INTERFACE": "CGI/1.1", "HTTP_ACCEPT": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8", "HTTP_ACCEPT_ENCODING": "gzip, deflate, sdch, br", "HTTP_ACCEPT_LANGUAGE": "zh-CN,zh;q=0.8", "HTTP_CONNECTION": "keep-alive", "HTTP_HOST": "127.0.0.1:43110", "HTTP_UPGRADE_INSECURE_REQUESTS": "1", "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36", "PATH_INFO": "/site_path/songs/\u592a\u4e0a\u8001\u541b\u8bf4\u6e05\u9759\u7ecf.mp3", "QUERY_STRING": "", "REMOTE_ADDR": "127.0.0.1", "REMOTE_PORT": "52721", "REQUEST_METHOD": "GET", "SCRIPT_NAME": "", "SERVER_NAME": "wangpan.cc", "SERVER_PORT": "43110", "SERVER_PROTOCOL": "HTTP/1.1", "SERVER_SOFTWARE": "gevent/1.1 Python/2.7", "arguments": { "action": "main", "batch": false, "bit_resolver": "1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F", "coffeescript_compiler": "type %s | tools\coffee\coffee.cmd", "config_file": "zeronet.conf", "connected_limit": 10, "data_dir": "data", "debug": false, "debug_gevent": false, "debug_socket": false, "disable_db": false, "disable_encryption": false, "disable_sslcompression": true, "disable_udp": false, "fileserver_ip": "*", "fileserver_port": 15441, "homepage": "1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D", "ip_external": null, "keep_ssl_cert": false, "language": "zh", "log_dir": "log", "max_files_opened": 2048, "msgpack_purepython": true, "open_browser": "default_browser", "optional_limit": "10%", "proxy": null, "size_limit": 10, "stream_downloads": false, "tor": "enable", "tor_controller": "127.0.0.1:9051", "tor_proxy": "127.0.0.1:9050", "trackers": [ "zero://boot3rdez4rzn36x.onion:15441", "zero://boot.zeronet.io#f36ca555bee6ba216b14d10f38c16f7769ff064e0e37d887603548cc2e64191d:15441", "udp://tracker.coppersurfer.tk:6969", "udp://tracker.leechers-paradise.org:6969", "udp://9.rarbg.com:2710", "http://tracker.tordb.ml:6881/announce", "http://explodie.org:6969/announce", "http://tracker1.wasabii.com.tw:6969/announce" ], "trackers_file": false, "ui_ip": "127.0.0.1", "ui_port": 43110, "ui_restrict": false, "updatesite": "1UPDatEDxnvHDo7TXvq6AEBARfNkyfxsp", "use_openssl": true, "use_tempfiles": false, "verbose": false }, "plugins": [ "AnnounceZero", "CryptMessage", "MergerSite", "Newsfeed", "OptionalManager", "PeerDb", "Sidebar", "Stats", "TranslateSite", "Trayicon", "Zeroname" ], "version_gevent": "1.1.2", "version_python": "2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)]", "version_zeronet": "0.5.1 r1786", "wsgi.url_scheme": "http" }

url: http://127.0.0.1:43110/site_address/songs/a.mp3 success

It seems like zeronet can't decode Chinese file name. Win7X64, zeronet version 0.5.1 r1786

HelloZeroNet commented 7 years ago

Non-ascii filenames not supported atm and automatically removed from sites.

sergei-bondarenko commented 7 years ago

Wow, that's harsh.