Documentation
¶
Overview ¶
Copyright 2026 YLD Limited SPDX-License-Identifier: Apache-2.0 Package unescape rewrites the Unicode escape sequences that hclwrite and gopkg.in/yaml.v3 emit for characters they wrongly treat as unprintable, restoring the raw UTF-8 without touching escapes the source itself contained.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unicode ¶
Unicode replaces \uXXXX and \UXXXXXXXX escape sequences with their raw UTF-8 equivalents for characters above U+009F. Both hclwrite and gopkg.in/yaml.v3 escape characters that are printable in their output format: hclwrite escapes any rune Go's unicode.IsPrint rejects, which includes category-Cf characters such as U+200D (ZWJ), and yaml.v3's is_printable helper only recognises 3-byte UTF-8, so supplementary-plane characters (emoji) are escaped too.
An escape the source itself contained is left alone. A writer emits a literal backslash doubled, so a run of backslashes of even length before "uXXXX" is text rather than an escape.
Types ¶
This section is empty.