syntax = "proto2";

package utf8validation.proto2;

option java_package = "com.google.protobuf.utf8validation";
option java_outer_classname = "Utf8TestProto2CheckedProto";
option java_multiple_files = true;
option java_string_check_utf8 = true;

// Naming convention for test fields:
// file_[java_string_check_utf8 state {unset, false, true}]_field_[enforce_utf8
// state {unset, enforced}]
message Utf8TestProto2Checked {
  optional string file_checked_field_unset = 1;

  // TODO: Enable once allowlist entry is built into protoc.
  // optional string file_checked_field_unenforced = 2 [enforce_utf8 = false];

  optional string file_checked_field_enforced = 3 [enforce_utf8 = true];

  extensions 100 to 200;
}

extend Utf8TestProto2Checked {
  optional string ext_file_checked_field_unset = 100;

  // TODO: Enable once allowlist entry is built into protoc.
  // optional string ext_file_checked_field_unenforced = 101 [enforce_utf8 =
  // false];

  optional string ext_file_checked_field_enforced = 102 [enforce_utf8 = true];
}
