go
data_error
ai_generated
true
rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8
ID: go/grpc-internal-status-details
80%Fix Rate
85%Confidence
0Evidence
2024-08-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.x | active | — | — | — |
Root Cause
A protobuf string field contains bytes that are not valid UTF-8. Protobuf strings must be valid UTF-8; otherwise, marshaling fails.
generic中文
protobuf 字符串字段包含不是有效 UTF-8 的字节。protobuf 字符串必须是有效的 UTF-8;否则序列化会失败。
Workarounds
-
90% success
s = strings.ToValidUTF8(s, "")
-
85% success
Use utf8.ValidString(s) to check before sending.
Dead Ends
Common approaches that don't work:
-
60% fail
This changes the API contract and may break compatibility.
-
70% fail
This corrupts the data and may not be acceptable.