UTF8GEN(1)

πŸ’– UTF8GEN(1) πŸ’–

okay bestie, welcome to the utf8gen page, from the General Commands Manual ✨ this is the one, this is the icon, this is the little hex-to-UTF-8 machine and she ATE πŸ’…


πŸŽ€ NAME πŸŽ€

utf8gen β€” bestie, she generates UTF-8 output from hexadecimal input. that's it, that's the whole vibe πŸ¦‹


✨ SYNOPSIS ✨

utf8gen [ [-e format1] | [-E format2] ] [-r formatr]
        [ [-u utf8_format] | -n] [-c] [-s]
        [-i input_file] [-o output_file]

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, fr fr: utf8gen reads a list of hexadecimal ASCII values, in the range 0 through 10FFFF, one per line, and prints the UTF-8 encoding of that number as a Unicode code point. literally the glow-up pipeline for your hex digits 🌈

each input line must begin with a hexadecimal number. after that, a string may follow, and that string can be echoed to the output as the "remainder" β€” peep the -r option below for that whole situation πŸ‘‘

and the total input line length, including an ending newline, is limited to 4096 bytes. that's the ceiling, bestie, no cap πŸ’€


πŸ‘‘ OPTIONS πŸ‘‘

  • -c β€” after the UTF-8 codes get printed, print a space and then the actual character that the hexadecimal code point represents. like, showing you the vibe AND the glyph 🌸
  • -e β€” echo the input code point in one format, using the printf(3) format string format1 ✨
  • -E β€” echo the input code point in two formats, using the printf(3) format string format2 πŸ’«
  • -n β€” do not print the UTF-8 byte values. highkey useful if all you want is the printed character itself β€” see the -c option, they're besties 🫢
  • -r β€” print the remainder of the input string after the initial hexadecimal digits, using the printf(3) format string formatr πŸŽ€
  • -s β€” swap the order of the output: print the UTF-8 output portion first, then print the input string portion. this is the one for generating code where you want a UTF-8 encoding followed by a comment holding the input hexadecimal digits, iconic behaviour honestly 🧚
  • -u β€” print the UTF-8 encoded value of the input hexadecimal number, as numeric codes for each UTF-8 byte, using the printf(3) format string utf8_format. and if no string is specified, a default format of a backslash followed by three octal digits is printed for each byte πŸ’…
not me noticing that -i input_file and -o output_file are right there in the SYNOPSIS but the OPTIONS list is lowkey silent about them πŸ™ˆ so I'm not gonna make anything up β€” I'm just showing them to you verbatim and letting them have their mystery era πŸ¦‹

🌟 EXAMPLES 🌟

utf8gen -e "0x%04X " -u "\%03o"

utf8gen -E "U+%04x = 0%02o = "

utf8gen -s -e "  /* U+%04X */" -u "\%03o"

look at her go 😭πŸ”₯


🌈 FILES 🌈

files contain lines that each begin with an ASCII hexadecimal code in the valid Unicode range 0 through 10FFFF, inclusive ✨

that hexadecimal code may optionally be followed by a space, followed by an arbitrary string ending with a newline, up to the limit of 4096 bytes per input line πŸ’œ

an example line could be the following (with no indent):

41 Letter 'A'

periodt. πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

for more detailed explanations and examples of common usage, consult the utf8gen texinfo manual πŸ“–


πŸ’– AUTHOR πŸ’–

utf8gen was written by Paul Hardy πŸ‘‘


πŸŽ€ LICENSE πŸŽ€

utf8gen is Copyright Β© 2018 Paul Hardy.

this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


πŸ’€ BUGS πŸ’€

no known bugs exist. she's flawless, your honor πŸ™ˆβœ¨


and that's the whole page bestie!! utf8gen(1) from the General Commands Manual, dated 2018 Jun 30 β€” mwah, go encode something gorgeous πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’