File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -572,6 +572,14 @@ where there's a language-specific `utf8_validation` feature that overrides it.
572572See [ ` features.(pb.java).utf8_validation ` ] ( #java-utf8_validation ) for the
573573Java-language-specific feature.
574574
575+ ** Important:** In Java, ` map<string, ...> ` fields always undergo UTF-8
576+ validation, even when ` utf8_validation = NONE ` is configured. Because Java keys
577+ will be represented as ` java.lang.String ` objects, disabling validation would
578+ force the runtime to convert invalid byte sequences * lossily* using replacement
579+ characters. This lossy conversion can result in unexpected behavior, such as key
580+ collisions. As a wire-compatible workaround, consider using a ` repeated ` field
581+ with a custom "map entry" message instead.
582+
575583This feature doesn't impact proto3 files, so this section doesn't have a before
576584and after of a proto3 file.
577585
You can’t perform that action at this time.
0 commit comments