unaccent(1)

πŸ’… unaccent(1) β€” bestie, it's the General Commands Manual energy

okay so you found unaccent and honestly? iconic tool. it removes accents from a stream or a string, and i'm about to tell you literally everything about it. no gatekeeping in this group chat πŸ’–


✨ NAME ✨

unaccent β€” remove accents from input stream or a string

like... that's the whole vibe. accents in, un-accented out. slay.


πŸŽ€ SYNOPSIS πŸŽ€

unaccent [--debug_low] [--debug_high] [-h] charset [string] [expected]

that's it. that's the lineup. keep reading, i promise it makes sense πŸ¦‹


🌸 DESCRIPTION 🌸

So here's how it goes, bestie, depending on how many args you hand it:

  • With a single argument, unaccent reads data from stdin, swaps every accented letter for its unaccented equivalent, and writes the result on stdout. chill, right?
  • If the second argument (string) is provided, unaccent transforms it instead, replacing accented letters by their unaccented equivalent, and prints the result on the standard output. so no stdin involved, it's just doing the thing to your lil string.
  • The charset of the input string, or of the data you piped in from stdin, is specified by the charset argument (ISO-8859-15 for instance). and yes, the output is printed using the same charset. periodt.
  • If the expected argument is provided, the output string gets compared to it, and if they are not equal unaccent exits on error. it's giving "i checked your homework" 🫢

ngl the machinery under the hood is kinda cute: unaccent relies on the iconv(3) library to convert from the specified charset to UTF-16BE (or UTF-16 if UTF-16BE is not available). so you should check the manual pages for available charsets. and on GNU/Linux, this command:

iconv -l

shows all available charsets. run it, scroll it, romanticize it ✨


πŸ‘‘ OPTIONS πŸ‘‘

  • --debug_low β€” prints human readable information about the unaccentuation process. see unac(3) for more information.
  • --debug_high β€” prints very detailed information about the unaccentuation process. see unac(3) for more information. (yes, more detail than --debug_low. it's giving overachiever, and we love that.)
  • --help, -h β€” prints a short usage and exits.

πŸ’– EXAMPLES πŸ’–

example one: string goes in, accents come out

Remove accents from the string Γ©tΓ© and check that the result is ete.

unaccent ISO-8859-1 Γ©tΓ© ete

see how expected is doing its lil quality check? obsessed.

example two: file in, file out

Remove accents from file myfile and put the result in file myfile.unaccent

unaccent ISO-8859-1 < myfile > myfile.unaccent

redirection girlies rise up 🌈


πŸ”₯ SEE ALSO πŸ”₯

unac(3), iconv(3)

go read those too, iykyk πŸ’œ


🧚 AUTHOR 🧚

Loic Dachary loic@senga.org http://www.senga.org/unac/


reminder bestie: the expected check means a mismatch = error exit, so don't be surprised when it yells at you. it's not being mean, it's being correct πŸ’…

and that's the whole page! this one's from the local source, version... local, and it lives in section unaccent(1). mwah, go un-accent something gorgeous πŸŒŸπŸ’–

πŸ“¦ where this page comes from