Reference documentation and code samples for the Google Cloud Natural Language v1 API enum 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.
If EncodingType is not specified, encoding-dependent information (such as
begin_offset) will be set at -1.
Utf16
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
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.
Utf8
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.
[[["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."],[[["\u003cp\u003eThe latest version available for the Google Cloud Natural Language v1 API is 3.7.0, and the page includes documentation for multiple older versions, ranging down to version 2.2.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEncodingType\u003c/code\u003e enum is part of the \u003ccode\u003eGoogle.Cloud.Language.V1\u003c/code\u003e namespace within the \u003ccode\u003eGoogle.Cloud.Language.V1.dll\u003c/code\u003e assembly, and represents the text encoding used to process output.\u003c/p\u003e\n"],["\u003cp\u003eThe API recommends providing an \u003ccode\u003eEncodingType\u003c/code\u003e to ensure proper handling of encoding-dependent information like \u003ccode\u003ebegin_offset\u003c/code\u003e for languages with different text encodings.\u003c/p\u003e\n"],["\u003cp\u003eThere are four encoding types available: \u003ccode\u003eNone\u003c/code\u003e (default if not specified), \u003ccode\u003eUtf16\u003c/code\u003e, \u003ccode\u003eUtf32\u003c/code\u003e, and \u003ccode\u003eUtf8\u003c/code\u003e, which determine how encoding-dependent information is calculated.\u003c/p\u003e\n"],["\u003cp\u003eEach encoding type, such as \u003ccode\u003eUtf8\u003c/code\u003e, \u003ccode\u003eUtf16\u003c/code\u003e and \u003ccode\u003eUtf32\u003c/code\u003e correspond to specific languages, like \u003ccode\u003eC++\u003c/code\u003e and \u003ccode\u003eGo\u003c/code\u003e for \u003ccode\u003eUtf8\u003c/code\u003e, with native support for each type.\u003c/p\u003e\n"]]],[],null,[]]