hprose / hprose-java

Hprose is a cross-language RPC. This project is Hprose 2.0 for Java
MIT License
550 stars 187 forks source link

get 乱码 #59

Open yuyedaidao opened 4 years ago

yuyedaidao commented 4 years ago

获取方法列表时返回的是乱码 image

andot commented 4 years ago

你方法名都是中文的?

yuyedaidao commented 4 years ago

小马哥 notifications@github.com于2020年6月2日 周二下午11:17写道:

你方法名都是中文的?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hprose/hprose-java/issues/59#issuecomment-637609182, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQPQDV4HBUPCJ5D6GWZ723RUUJXNANCNFSM4NQSLB5A .

肯定不是中文的,是编码问题吗,没找到设置编码的地方

andot commented 4 years ago

应该是编码问题,hprose输出的字符串是utf8编码的,但是如果没有汉字的情况下,即使浏览器当成ascii显示也应该是正常的啊,显示成这种乱码格式,我也不知道浏览器把它当成什么编码格式了。

yuyedaidao commented 4 years ago

image 这段代码能执行吗?🤣

yuyedaidao commented 4 years ago

上边的诡异代码在我更新了一遍maven的库之后正常了,但是依然返回乱码

yuyedaidao commented 4 years ago

直接用浏览器访问会当成文件下载,但是打开文件内容为空

andot commented 4 years ago

返回值设置的 Content-Type 是 "text/plain",我觉得也许是服务器本身不支持造成的吧。不过这个 get 返回什么不重要,不影响正常调用。

yuyedaidao commented 4 years ago

image

这里处理一下之后可以正常返回了,但是请求后很长很长时间才返回