Reference documentation and code samples for the Cloud Natural Language V1 Client class EncodingType.
Represents the text encoding that the caller uses to process the output.
Providing an EncodingType is 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.
Protobuf type google.cloud.language.v1.EncodingType
Namespace
Google \ Cloud \ Language \ V1
Methods
static::name
Parameter
Name
Description
value
mixed
static::value
Parameter
Name
Description
name
mixed
Constants
NONE
Value: 0
If EncodingType is not specified, encoding-dependent information (such as
begin_offset) will be set at -1.
Generated from protobuf enum NONE = 0;
UTF8
Value: 1
Encoding-dependent information (such as begin_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 enum UTF8 = 1;
UTF16
Value: 2
Encoding-dependent information (such as begin_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 enum UTF16 = 2;
UTF32
Value: 3
Encoding-dependent information (such as begin_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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Cloud Natural Language V1 Client - Class EncodingType (1.0.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.1 (latest)](/php/docs/reference/cloud-language/latest/V1.EncodingType)\n- [1.0.0](/php/docs/reference/cloud-language/1.0.0/V1.EncodingType)\n- [0.34.3](/php/docs/reference/cloud-language/0.34.3/V1.EncodingType)\n- [0.33.0](/php/docs/reference/cloud-language/0.33.0/V1.EncodingType)\n- [0.32.7](/php/docs/reference/cloud-language/0.32.7/V1.EncodingType)\n- [0.31.3](/php/docs/reference/cloud-language/0.31.3/V1.EncodingType)\n- [0.30.2](/php/docs/reference/cloud-language/0.30.2/V1.EncodingType)\n- [0.29.0](/php/docs/reference/cloud-language/0.29.0/V1.EncodingType)\n- [0.28.5](/php/docs/reference/cloud-language/0.28.5/V1.EncodingType) \nReference documentation and code samples for the Cloud Natural Language V1 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.v1.EncodingType`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Language \\\\ V1\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;`"]]