You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/06/21 06:29:07 UTC

[GitHub] [servicecomb-java-chassis] chenchanglong1997 opened a new issue #2427: 传递中文乱码

chenchanglong1997 opened a new issue #2427:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2427


   实现httpClintFilter,   向里面传中文value,解析乱码 
   客户端:public void beforeSendRequest(Invocation invocation, HttpServletRequestEx requestEx) {
           // 发送前设置上下文,传输到服务端
           TransferContextHelper.injectCommonContext(invocation,
               (TransferContextHelper.Setter<Invocation>) (request, key, value) -> invocation.addContext(key, value));
   
   服务端    public Response afterReceiveRequest(Invocation invocation, HttpServletRequestEx requestEx) {
           ContextManager.clearAll();
           TransferContextHelper.extractCommonContext(invocation, InvocationContext::getContext);
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 closed issue #2427: 传递中文乱码

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 closed issue #2427:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2427


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2427: 传递中文乱码

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2427:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2427#issuecomment-865503089


   Http协议里面明确了header只支持一种编码,不能使用中文。 如果需要使用中文,需要业务自行编码后,在设置到header, 使用端自行解码。 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2427: 传递中文乱码

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2427:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2427#issuecomment-865503089


   Http协议里面明确了header只支持一种编码,不能使用中文。 如果需要使用中文,需要业务自行编码后,设置到header, 使用端自行解码。 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2427: 传递中文乱码

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2427:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2427#issuecomment-865503089


   Http协议里面明确了header只支持一种编码,不能使用中文。 如果需要使用中文,需要业务自行编码后,在设置到header, 使用端自行解码。 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2427: 传递中文乱码

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2427:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2427#issuecomment-865503089


   Http协议里面明确了header只支持一种编码,不能使用中文。 如果需要使用中文,需要业务自行编码后,设置到header, 使用端自行解码。 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org