HTTP/2 200
content-security-policy: object-src 'none'; base-uri 'none'; script-src 'unsafe-inline' 'strict-dynamic' https: http: 'sha256-DVdvl49HC0iGx/YKQq/kVNATnEdzGfExbJVTHqT95l8=' 'sha256-CoGrkqEM1Kjjf5b1bpcnDLl8ZZLAsVX+BoAzZ5+AOmc=' 'sha256-QqhlxKosyquihHG/Jahbski3BB1pDss2/CDgLzKKbmE=' 'sha256-karKh1IrXOF1g+uoSxK+k9BuciCwYY/ytGuQVUiRzcM=' 'sha256-mxm3e8M0u3nPPBmLIBgGuMvGUIL5LGv+HzV3bLAIBgw=' 'sha256-+iS8jRq15Ez/Kzz0/G+SNc0geLNvTyf2NZC7MyJgpRE=' 'sha256-UiVwSVJIK9udADqG5GZe+nRUXWK9wEot2vrxL4D2pQs=' 'sha256-cB+y/oSfWGFf7lHk8KX+ZX2CZQz/dPamIICuPvHcB6w=' 'sha256-7mi5SPcD1cogj2+ju8J/+/qJG99F6Qo+3pO4xQkRf6Q=' 'sha256-rEbn/zvLCsDDvDrVWQuUkKGEQsjQjFvIvJK4NVIMqZ4='
x-content-type-options: nosniff
x-frame-options: deny
content-type: text/html; charset=utf-8
date: Tue, 15 Jul 2025 22:18:55 GMT
server: Google Frontend
via: 1.1 google
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Discover Packages
Standard library
unicode
utf16
package
standard library
Version:
go1.24.5
Opens a new window with list of versions in this module.
Published: Jul 8, 2025
License: BSD-3-Clause
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 9,604
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package utf16 implements encoding and decoding of UTF-16 sequences.
AppendRune appends the UTF-16 encoding of the Unicode code point r
to the end of p and returns the extended buffer. If the rune is not
a valid Unicode code point, it appends the encoding of U+FFFD.
Decode returns the Unicode code point sequence represented
by the UTF-16 encoding s.
DecodeRune returns the UTF-16 decoding of a surrogate pair.
If the pair is not a valid UTF-16 surrogate pair, DecodeRune returns
the Unicode replacement code point U+FFFD.
Encode returns the UTF-16 encoding of the Unicode code point sequence s.
EncodeRune returns the UTF-16 surrogate pair r1, r2 for the given rune.
If the rune is not a valid Unicode code point or does not need encoding,
EncodeRune returns U+FFFD, U+FFFD.
IsSurrogate reports whether the specified Unicode code point
can appear in a surrogate pair.
RuneLen returns the number of 16-bit words in the UTF-16 encoding of the rune.
It returns -1 if the rune is not a valid value to encode in UTF-16.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.