You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/12/28 10:45:23 UTC

[GitHub] [dubbo-go-hessian2] yakecanlee opened a new issue #252: decode fail when received string from server,and string contains emoji and chinese

yakecanlee opened a new issue #252:
URL: https://github.com/apache/dubbo-go-hessian2/issues/252


   <!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
   
   -->
   
   
   **What happened**:
   
   dubbo server's response contain a string, and it contains emoji and chinese. dubbo client will fail in decode pkg.
   ```
   ERRO[0001] pkg.Unmarshal(len(@data):0) = error:bad utf-8 encoding
   github.com/apache/dubbo-go-hessian2.(*Decoder).decString
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/string.go:481
   github.com/apache/dubbo-go-hessian2.(*Decoder).decInstance
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/object.go:403
   github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/object.go:672
   github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/decode.go:260
   github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/object.go:631
   github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/decode.go:260
   github.com/apache/dubbo-go-hessian2.(*Decoder).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/decode.go:189
   github.com/apache/dubbo-go/protocol/dubbo/impl.unmarshalResponseBody
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/hessian.go:307
   github.com/apache/dubbo-go/protocol/dubbo/impl.HessianSerializer.Unmarshal
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/hessian.go:60
   github.com/apache/dubbo-go/protocol/dubbo/impl.(*ProtocolCodec).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/codec.go:185
   github.com/apache/dubbo-go/protocol/dubbo/impl.(*DubboPackage).Unmarshal
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/package.go:93
   github.com/apache/dubbo-go/protocol/dubbo.(*DubboCodec).decodeResponse
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/dubbo_codec.go:242
   github.com/apache/dubbo-go/protocol/dubbo.(*DubboCodec).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/dubbo_codec.go:172
   github.com/apache/dubbo-go/remoting/getty.(*RpcClientPackageHandler).Read
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/remoting/getty/readwriter.go:52
   github.com/apache/dubbo-getty.(*session).handleTCPPackage
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-getty@v1.3.10/session.go:775
   github.com/apache/dubbo-getty.(*session).handlePackage
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-getty@v1.3.10/session.go:697
   runtime.goexit
   	/usr/local/Cellar/go/1.15.3/libexec/src/runtime/asm_amd64.s:1374
   decInstance->ReadString: content
   github.com/apache/dubbo-go-hessian2.(*Decoder).decInstance
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/object.go:405
   github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/object.go:672
   github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/decode.go:260
   github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/object.go:631
   github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/decode.go:260
   github.com/apache/dubbo-go-hessian2.(*Decoder).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go-hessian2@v1.7.0/decode.go:189
   github.com/apache/dubbo-go/protocol/dubbo/impl.unmarshalResponseBody
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/hessian.go:307
   github.com/apache/dubbo-go/protocol/dubbo/impl.HessianSerializer.Unmarshal
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/hessian.go:60
   github.com/apache/dubbo-go/protocol/dubbo/impl.(*ProtocolCodec).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/codec.go:185
   github.com/apache/dubbo-go/protocol/dubbo/impl.(*DubboPackage).Unmarshal
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/package.go:93
   github.com/apache/dubbo-go/protocol/dubbo.(*DubboCodec).decodeResponse
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/dubbo_codec.go:242
   github.com/apache/dubbo-go/protocol/dubbo.(*DubboCodec).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/dubbo_codec.go:172
   github.com/apache/dubbo-go/remoting/getty.(*RpcClientPackageHandler).Read
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/remoting/getty/readwriter.go:52
   github.com/apache/dubbo-getty.(*session).handleTCPPackage
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-getty@v1.3.10/session.go:775
   github.com/apache/dubbo-getty.(*session).handlePackage
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-getty@v1.3.10/session.go:697
   runtime.goexit
   	/usr/local/Cellar/go/1.15.3/libexec/src/runtime/asm_amd64.s:1374
   github.com/apache/dubbo-go/protocol/dubbo/impl.unmarshalResponseBody
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/hessian.go:309
   github.com/apache/dubbo-go/protocol/dubbo/impl.HessianSerializer.Unmarshal
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/hessian.go:60
   github.com/apache/dubbo-go/protocol/dubbo/impl.(*ProtocolCodec).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/codec.go:185
   github.com/apache/dubbo-go/protocol/dubbo/impl.(*DubboPackage).Unmarshal
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/impl/package.go:93
   github.com/apache/dubbo-go/protocol/dubbo.(*DubboCodec).decodeResponse
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/dubbo_codec.go:242
   github.com/apache/dubbo-go/protocol/dubbo.(*DubboCodec).Decode
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/protocol/dubbo/dubbo_codec.go:172
   github.com/apache/dubbo-go/remoting/getty.(*RpcClientPackageHandler).Read
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-go@v1.5.5-rc1/remoting/getty/readwriter.go:52
   github.com/apache/dubbo-getty.(*session).handleTCPPackage
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-getty@v1.3.10/session.go:775
   github.com/apache/dubbo-getty.(*session).handlePackage
   	/Users/yakecanlee/go/pkg/mod/github.com/apache/dubbo-getty@v1.3.10/session.go:697
   runtime.goexit
   	/usr/local/Cellar/go/1.15.3/libexec/src/runtime/asm_amd64.s:1374 
   ```
   
   **What you expected to happen**:
   
   decode success
   
   **How to reproduce it (as minimally and precisely as possible)**:
   
   server struct
   ```
   public class DTO implements Serializable {
   
       private Long msgId;
       private Long userId;
       private Long toUserId;
       private String content;
       private Integer msgType;
       private Date gmtCreate;
    
       //getter setter
   
   }
   ```
   
   client struct
   ```
   type UserMsgBody struct {
   	MsgId          int64     `json:"msgId,omitempty"`
   	UserId         int64     `json:"userId,omitempty"`
   	ToUserId       int64     `json:"toUserId,omitempty"`
   	Content        string    `json:"content,omitempty"`
   	MsgType        int       `json:"msgType,omitempty"`
   	GmtCreate      time.Time `json:"gmtCreate,omitempty"`
   }
   ```
   value
   ```
   mqUserMsgBody := entity.UserMsgBody{
   		UserId:    1,
   		ToUserId:  2,
   		MsgType:   1,
   		Content:   "❄️🚫🚫🚫🚫 多次自我介绍、任务、动态和",
   	}
   ```
   
   **Anything else we need to know?**:
   
   dubbo server: dubbo-2.7.7 java
   dubbo client: dubbo-go v1.5.5.rc1
   hession: dubbo-go-hessian2@v1.7.0
   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-hessian2] AlexStocks closed issue #252: decode fail when received string from server,and string contains emoji and chinese

Posted by GitBox <gi...@apache.org>.
AlexStocks closed issue #252:
URL: https://github.com/apache/dubbo-go-hessian2/issues/252


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-hessian2] wongoo commented on issue #252: decode fail when received string from server,and string contains emoji and chinese

Posted by GitBox <gi...@apache.org>.
wongoo commented on issue #252:
URL: https://github.com/apache/dubbo-go-hessian2/issues/252#issuecomment-752801480


   I have reproduced this issue, I will try to fix it.


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org