GOLF(2gg)
๐ GOLF(2gg) ๐
okay bestie, welcome to the 2gg manual section, we're doing GOLF today and honestly? it's giving โจreference materialโจ
๐ธ NAME ๐ธ
text-utf โ the (UTF) one ๐ฆ
๐ PURPOSE ๐
Convert text to a UTF (UTF8 or UTF16) string. no cap, that's the whole job ๐
โจ SYNTAX โจ
text-utf <text> \
[ status <status> ] \
[ error-text <error text> ]
look at her, so clean, so demure ๐ซถ
๐ DESCRIPTION ๐
so like, text-utf takes that string value <text> and converts it to UTF. and here's the thing โ <text> itself will hold the resulting UTF string. like she's doing a little makeover on the spot, in place, no returns.
โ ๏ธ if you don't wish<text>to be modified, make a copy of it first (seecopy-string). protect your original bestie, she's precious ๐
also, for the reverse conversion AND the data standards info, go peek at utf-text. they're a duo ๐
so about <status> โ you can obtain it in the status clause. the <status> number is GG_OKAY if successful, or GG_ERR_UTF if there was an error. and in that error case, the <error text> string in the error-text clause will contain the error message. very much "we'll tell you what went wrong" energy ๐ญ
๐ฅ EXAMPLES ๐ฅ
okay so first, the Unicode value we're encoding to UTF8 or UTF16 (such as \euD834\euDD1E as a surrogate pair, iykyk):
// Unicode value to encode to UTF8 or UTF16 (such as \euD834\euDD1E as a surrogate pair)
set-string txt = "\u0459\\"Doc\\"\en\et\eb\ef\er\et\eu21d7\eu21d8\et\eu25b7\eu25ee\euD834\euDD1E\eu13eb\eu2ca0\eu0448\en\e/\\"()\et"
now convert it to UTF:
// Convert to UTF
text-utf txt status txt_status error-text txt_error
and here's the expected UTF result, look at her go ๐:
// Expected UTF result
set-string utf = "ั\"Doc\"\n\t\b\f\r\tโโ\tโทโฎ๐แซโฒ ั\n/\"()\t"
and finally, make sure the conversion was actually successful, because we do NOT skip the vibe check:
// Make sure conversion was successful
if-true utf not-equal txt or txt_status not-equal GG_OKAY or txt_error not-equal ""
@Error in converting string to UTF
end-if
ate. no crumbs. ๐
๐ SEE ALSO ๐
UTFtext-utfutf-text
and yesss, See all documentation for the full lore ๐
okay that's the whole page bestie, you're officially fluent ๐
this icon of a page came from the $VERSION era, dated $DATE, and it lives in the GOLF(2gg) family โ slay, periodt ๐
โจ
๐ฆ where this page comes from
- ubuntu questing: golf 601.4.41-1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms