Reference documentation and code samples for the Cloud Natural Language V2 Client class EncodingType.
Represents the text encoding that the caller uses to process the output.
Providing anEncodingTypeis recommended because the API provides the
beginning offsets for various outputs, such as tokens and mentions, and
languages that natively use different text encodings may access offsets
differently.
IfEncodingTypeis not specified, encoding-dependent information (such asbegin_offset) will be set at-1.
Generated from protobuf enumNONE = 0;
UTF8
Value: 1
Encoding-dependent information (such asbegin_offset) is calculated based
on the UTF-8 encoding of the input. C++ and Go are examples of languages
that use this encoding natively.
Generated from protobuf enumUTF8 = 1;
UTF16
Value: 2
Encoding-dependent information (such asbegin_offset) is calculated based
on the UTF-16 encoding of the input. Java and JavaScript are examples of
languages that use this encoding natively.
Generated from protobuf enumUTF16 = 2;
UTF32
Value: 3
Encoding-dependent information (such asbegin_offset) is calculated based
on the UTF-32 encoding of the input. Python is an example of a language
that uses this encoding natively.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Natural Language V2 Client - Class EncodingType (1.0.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.1 (latest)](/php/docs/reference/cloud-language/latest/V2.EncodingType)\n- [1.0.0](/php/docs/reference/cloud-language/1.0.0/V2.EncodingType)\n- [0.34.3](/php/docs/reference/cloud-language/0.34.3/V2.EncodingType)\n- [0.33.0](/php/docs/reference/cloud-language/0.33.0/V2.EncodingType)\n- [0.32.7](/php/docs/reference/cloud-language/0.32.7/V2.EncodingType)\n- [0.31.3](/php/docs/reference/cloud-language/0.31.3/V2.EncodingType)\n- [0.30.2](/php/docs/reference/cloud-language/0.30.2/V2.EncodingType)\n- [0.29.0](/php/docs/reference/cloud-language/0.29.0/V2.EncodingType)\n- [0.28.5](/php/docs/reference/cloud-language/0.28.5/V2.EncodingType) \nReference documentation and code samples for the Cloud Natural Language V2 Client class EncodingType.\n\nRepresents the text encoding that the caller uses to process the output.\n\nProviding an `EncodingType` is recommended because the API provides the\nbeginning offsets for various outputs, such as tokens and mentions, and\nlanguages that natively use different text encodings may access offsets\ndifferently.\n\nProtobuf type `google.cloud.language.v2.EncodingType`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Language \\\\ V2\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### NONE\n\n Value: 0\n\nIf `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.\n\nGenerated from protobuf enum `NONE = 0;`\n\n### UTF8\n\n Value: 1\n\nEncoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-8 encoding of the input. C++ and Go are examples of languages\nthat use this encoding natively.\n\nGenerated from protobuf enum `UTF8 = 1;`\n\n### UTF16\n\n Value: 2\n\nEncoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-16 encoding of the input. Java and JavaScript are examples of\nlanguages that use this encoding natively.\n\nGenerated from protobuf enum `UTF16 = 2;`\n\n### UTF32\n\n Value: 3\n\nEncoding-dependent information (such as `begin_offset`) is calculated based\non the UTF-32 encoding of the input. Python is an example of a language\nthat uses this encoding natively.\n\nGenerated from protobuf enum `UTF32 = 3;`"]]