Standard library / unicode/utf16
utf16.DecodeRune()
Decodes a valid high/low surrogate pair, otherwise returns U+FFFD. Expected stdout: 'U+1F600\n'.
Formal Syntax & Structure
go syntaxgo
func DecodeRune(r1, r2 rune) runeParameters & Attributes
| Name | Type | Description |
|---|---|---|
| r1 | rune | First code point of the surrogate pair. |
| r2 | rune | Second code point of the surrogate pair. |
Return Value
rune
Decodes a valid high/low surrogate pair, otherwise returns U+FFFD.
Working Example
Example Snippetgo
package main
import ( "fmt" "unicode/utf16")
func main() { fmt.Printf("%U\n", utf16.DecodeRune(0xd83d, 0xde00))}