Reference documentation and code samples for the Cloud Natural Language V2 API module Google::Cloud::Language::V2::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.
Constants
NONE
value: 0 If EncodingType is not specified, encoding-dependent information (such as
begin_offset) will be set at -1.
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.
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.
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"]],[["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 API - Module Google::Cloud::Language::V2::EncodingType (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType)\n- [1.0.1](/ruby/docs/reference/google-cloud-language-v2/1.0.1/Google-Cloud-Language-V2-EncodingType)\n- [0.7.0](/ruby/docs/reference/google-cloud-language-v2/0.7.0/Google-Cloud-Language-V2-EncodingType)\n- [0.6.0](/ruby/docs/reference/google-cloud-language-v2/0.6.0/Google-Cloud-Language-V2-EncodingType)\n- [0.5.1](/ruby/docs/reference/google-cloud-language-v2/0.5.1/Google-Cloud-Language-V2-EncodingType)\n- [0.4.0](/ruby/docs/reference/google-cloud-language-v2/0.4.0/Google-Cloud-Language-V2-EncodingType)\n- [0.3.2](/ruby/docs/reference/google-cloud-language-v2/0.3.2/Google-Cloud-Language-V2-EncodingType)\n- [0.2.0](/ruby/docs/reference/google-cloud-language-v2/0.2.0/Google-Cloud-Language-V2-EncodingType)\n- [0.1.0](/ruby/docs/reference/google-cloud-language-v2/0.1.0/Google-Cloud-Language-V2-EncodingType) \nReference documentation and code samples for the Cloud Natural Language V2 API module Google::Cloud::Language::V2::EncodingType.\n\nRepresents the text encoding that the caller uses to process the output.\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\nConstants\n---------\n\n### NONE\n\n**value:** 0 \nIf `EncodingType` is not specified, encoding-dependent information (such as\n`begin_offset`) will be set at `-1`.\n\n### UTF8\n\n**value:** 1 \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\n### UTF16\n\n**value:** 2 \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\n### UTF32\n\n**value:** 3 \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."]]