| 1 |
gRPC Internationalization |
| 2 |
========================= |
| 3 |
|
| 4 |
As a universal RPC framework, gRPC needs to be fully usable within/across different international environments. |
| 5 |
This document describes gRPC API and behavior specifics when used in a non-english environment. |
| 6 |
|
| 7 |
## API Concepts |
| 8 |
|
| 9 |
While some API elements need to be able to represent non-english content, some are intentionally left as ASCII-only |
| 10 |
for simplicity & performance reasons. |
| 11 |
|
| 12 |
### Method name (in RPC Invocation) |
| 13 |
Method names are ASCII-only and may only contain characters allowed by HTTP/2 text header values. That should not |
| 14 |
be very limiting as most gRPC services will use protobuf which only allows method names from an even more restricted ASCII subset. |
| 15 |
Also, handling method names is a very hot code path so any additional encoding/decoding step is to be avoided. |
| 16 |
|
| 17 |
Recommended representation in language-specific APIs: string type. |
| 18 |
|
| 19 |
### Host name (in RPC Invocation) |
| 20 |
Host names are punycode encoded, but the user is responsible for providing the punycode-encoded string if she wishes to use an internationalized host name. |
| 21 |
|
| 22 |
Recommended representation in language-specific APIs: string/unicode string. |
| 23 |
|
| 24 |
NOTE: overriding host name when invoking RPCs is only supported by C-core based gRPC implementations. |
| 25 |
|
| 26 |
### Status detail/message (accompanies RPC status code) |
| 27 |
|
| 28 |
Status messages are expected to contain national-alphabet characters. |
| 29 |
Allowed values are unicode strings (content will be percent-encoded on the wire). |
| 30 |
|
| 31 |
Recommended representation in language-specific APIs: unicode string. |
| 32 |
|
| 33 |
### Metadata key |
| 34 |
Allowed values are defined by HTTP/2 standard (metadata keys are represented as HTTP/2 header/trailer names). |
| 35 |
|
| 36 |
Recommended representation in language-specific APIs: string. |
| 37 |
|
| 38 |
### Metadata value (text-valued metadata) |
| 39 |
Allowed values are defined by HTTP/2 standard (metadata values are represented as HTTP/2 header/trailer text values). |
| 40 |
|
| 41 |
Recommended representation in language-specific APIs: string. |
| 42 |
|
| 43 |
### Channel target (in channel creation) |
| 44 |
|
| 45 |
TBD |