MBCONV(1)

πŸ“¦
version 1.5.8 Β· 4 versions
, in ubuntu jammy, ubuntu noble

MBCONV(1) β€” the character encoding scheme converter πŸ’…

okay bestie, gather round, because mbconv is literally the glow-up your messy multi-encoding files have been begging for ✨ it's the manual page for mbconv, and yes it eats encodings for breakfast.


NAME πŸŽ€

mbconv β€” Character encoding scheme converter


SYNOPSIS πŸ¦‹

mbconv [options] <file> ...

DESCRIPTION πŸ’–

So here's the vibe: this is an application of a library that handles multiple octets character encoding:

http://pub.ks-and-ks.ne.jp/prog/libmoe/

and honestly? it was mainly written for debugging of the library. like, it's the library's little test-runner bestie, we love that for it 🫢

What it does: it reads octet by octet from files given on command line (or standard input if no file is specified), converts character encoding scheme (CES) as specified by command line options (described below), and output to standard output (or a file specified by -t option or -a option). no cap. octet by octet, one at a time, iconically patient πŸ’…


Options πŸ‘‘

  • -?, -h, --help β€” display summary of options and exits. your lil cheat sheet, use it πŸ“
  • -a file, --append-to=file β€” output is appended to file. note: appended, not overwritten, okay? she adds on, she doesn't erase πŸ™ˆ
  • -c converters, --convert-to=converters β€” specifies character encoding conversion. converters must be comma separated list of words described in "Conversion specifiers". commas, bestie, commas πŸŽ€
  • -f flags, --flag=flags β€” specifies flags to change behavior of conversion. flags must be comma separated list of words describe in "Flag specifiers".
  • -i, --input β€” succeeding options apply to input stream. it's giving "everything after this is about the input" πŸ’œ
  • -m string, --mime-charset=string β€” mime encoding conforming to RFC2047 is performed. <string> is used as charset name.
  • -n, --line-number β€” line number (>= 1) is inserted to beginning of each line. numbered lines, main character energy πŸ”₯
  • -o, --output β€” succeeding options apply to output stream.
  • -t file, --to=file β€” output to file (truncated). ⚠️ truncated means the old contents are gone, so double-check that path before you commit, fr fr.
  • -w, --width β€” output width of each line.
  • -cs <string>, --charset=string β€” specifies charset name. Some language specifications are also accepted as well as MIME charset names, which are used to restrict candidates of encoding scheme of input stream. Acceptable languages are listed in "Acceptable languages". (yes it's -cs with the letters, not -c, don't get it twisted πŸ’€)
  • --format=string β€” specifies output format
  • --which β€” output charset name of each input stream to stderr, in the form
file name":" charset name

if two or more files are specifed on the command line, or

charset name

otherwise.

  • --regex=regular expression β€” specifies regeular expression to filter output. Character encoding of regular expression can be specified by putting string of the form
"*"charset name"*"

at the beginning of the regular expression, otherwise UTF-8. Character encoding of the expression is converted to that of output stream before matching. ✨ encoding-ception, we love to see it ✨


Conversion specifiers 🌈

Conversion is applied just before each character is output to stream. Conversion setup is automatically performed based on CES. So in most cases, yo need not to specify converters explicitly. (she's smart like that, she figures it out herself πŸ’…)

  • ascii β€” domestic ASCII converted to US-ASCII,
  • ces β€” converted appropriately according to the CES bound to input/output stream,
  • to-ucs β€” converted to Unicode,
  • f2h, full-to-half β€” Fullwidth compatibility characters are converted to corresponding halfwidth ones,
  • h2f, half-to-full β€” Halfwidth compatibility characters are converted to corresponding fullwidth ones,
  • jisx0213 β€” Codepoints in JIS C 6226 or in JIS X 0208 which are bound to no character are converted into JIS X 0213 plane 1,
  • jisx0213-aggressive β€” All codepoints in JIS C 6226 or in JIS X 0208 are converted into JIS X 0213 plane 1. all of them. aggressive is right there in the name, she's not subtle 😭
  • ms-latin1 β€” Unicode characters of code point between 0x80 and 0x9F (both inclusive) are converted to other Unicode characters as if they are characters of those code point in Microsoft Windows Codepage 1252.
  • ucs-to-jis0208-extra, jis0208-to-ucs-extra β€” Converters between some JIS X 0208 and Unicode characters having similar glyphs (by the courtesy of Ambrose Li <acli@ada.dhs.org>). shoutout Ambrose, absolute legend 🫢

Flag specifiers 🧚

  • use-0x28-for-94x94inG0, 28 β€” use "1/11 2/4 2/8 F" instead of "1/11 2/4 F" to designate charsets with final octet 4/0, 4/1, or 4/2 to G0,
  • ac, ascii-at-control β€” escape sequence "1/11 2/8 4/2" is output before every control character,
  • nossl, ignore-7bit-single-shift β€” escape sequence for 7 bit single shift is ignored,
  • dnc, discard-notprefered-char β€” discard characters which CES bound to output stream can not decode. (spelled notprefered in the flag name, keep it exactly like that, bestie β€” do not "fix" it πŸ’€)

Acceptable languages ⭐

The following words may be given instead of MIME charset name for input stream. In that case, encoding scheme is automatically detected (hopefully) among succeeding ones. yes, "hopefully" β€” she said what she said πŸ™ˆ

  • c, cn, china, chinese β€” x-gb-18030-2000, cn-big5, utf-8, or x-euc-tw.
  • j, ja, jp, japan, japanese β€” euc-jp, shift_jis, or utf-8.
  • k, ko, kr, korea, korean β€” euc-kr, x-johab, utf-8, or x-unified-hangul.
  • cjk β€” iso-8859-1, x-gb-18030-2000, cn-big5, x-euc-tw, euc-jp, shift_jis, euc-kr, x-johab, x-unified-hangul, or utf-8.

AUTHOR πŸ‘‘

Kiyokazu SUTO <suto@ks-and-ks.ne.jp>


DISCLAIMER etc. πŸ’€

This program is distributed with absolutely no warranty.

Anyone can use, modify, and re-distibute this program without any restriction.

like, absolutely no warranty. zero. none. she said it twice-ish and meant it. but also anyone can use, modify, and re-distibute it without any restriction, so it's giving generous queen πŸ’…

and that's the whole page, bestie! this one's living its best life as perl v5.28.0, dated 2018-10-04 β€” vintage but iconic, a true classic, no notes πŸŒΈπŸ¦‹πŸ’–

πŸ“¦ where this page comes from