CSTOCS(1p)

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

πŸ’– CSTOCS(1p) β€” the Czech & Slovak charset encoding glow-up πŸ’–

okay bestie, pull up a chair, because cstocs is literally the charset encoding convertor for the Czech and Slovak languages and she is serving.


✨ FORMAT ✨

cstocs [options] src_encoding dst_encoding [files ...]

that's the whole vibe: you tell her where you're coming from, you tell her where you're going, and optionally you hand her some files. πŸ¦‹


🌸 SYNOPSIS 🌸

cstocs il2 ascii < file | less
cstocs -i utf8 il2 file1 file2 file3
cstocs --help

see how easy that is?? first one pipes a file in and out to less, second one does the in-place thing on three files at once, third one is your little "help meee" moment. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

Cstocs is a simple conversion utility to change charset encoding of a text. That's the whole job, no cap. She reads either the files you specified or β€” if you specified literally none β€” the standard input. She assumes that input is encoded in src_encoding and ties to reencode it into dst_encoding. (yes, "ties", that's what the original says, we don't fix it, we love her.) The result goes to the standard output. ✨

Run cstocs with no parameters at all and you get short help plus the list of available encodings. lowkey the fastest way to vibe check what she can do. 🫢

Characters that are not defined in src_encoding get passed to the output unchanged. she's not gonna touch what she doesn't understand, and honestly? iconic boundaries.

Now here's the messy part, bestie, and it's giving drama. If the source text contains a character that is defined in src_encoding but not in dst_encoding, you've got choices. For example: character "e with caron" (symbol ecaron) and "d with caron" (symbol dcaron) are included in the iso-8859-2 encoding, but not in the iso-8859-1. So if you're reencoding 8859-2 text to 8859-1, you may want to do one of the following actions:

  1. Keep it the same, option --nofillstring. leave her alone, she's fine as she is πŸ’œ
  2. Do not produce any output instead of ecaron symbol, option --null. just… gone. vanished. πŸ’€
  3. Substitute some string (possibly a space) instead of both ecaron and dcaron, options --fillstring. something has to go there, might as well be a space 🌸
  4. Substitute a letter d instead of dcaron, and e instead of ecaron. And it gets better β€” it is even possible to substitute string instead of symbol, so you can replace the AE Latin character with string AE (letter A, and letter E). Or you can replace a plusminus sign with a string +/-. These substitutions are described in the accent file. πŸŽ€

πŸ’… OPTIONS πŸ’…

  • -i, -i.ext, --inplace.ext β€” Files specified will be converted in-place, using Perl -i facility. Optionally, an extension for backup copies may be specified after dot. This parameter has to be the first one, if specified. like, FIRST first. she's not playing about this. πŸ‘‘
  • --dir directory β€” Encoding files are taken from directory instead of the default, which is Cz/Cstocs/enc in the Perl lib tree. The location of encoding files can also be changed using the CSTOCSDIR environment variable, but the --dir option has the highest priority. priority queen behavior, fr fr πŸ’–
  • --fillstring string β€” If source text contains a character that is defined in the src_encoding but not in the dst_encoding nor in the accent file (or accent file is not used), it is replaced by string. The default is a single space. ✨
  • --nofillstring β€” Disable changes of characters that would otherwise have fillstring applied. This is different from --null because that cancels that character out. subtle but important, bestie πŸ¦‹
  • --null β€” Completely equivalent to --fillstring "". yeah. empty string. that's the whole thing. πŸ’€
  • --nochange or --noaccent β€” Do not use the accent file at all. like, we're not even opening that document πŸ“„πŸ™ˆ
  • --onebyone β€” Use only those rules from the accent file which rewrite one character to one character. If this option is specified, character ecaron will be rewritten to e, but AE character will not be rewritten to AE string. strict one-for-one, no extras, no cap 🌈
  • --onebymore β€” Use all rules from the accent file. This is the default option. so if you didn't say anything, this is what she was doing the whole time πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

Cz::Cstocs(3) β€” go read the module bestie, she's right there πŸ’–


πŸŽ€ AUTHOR πŸŽ€

Jan "Yenya" Kasprzak has done the original Un*x implementation. 🌟

Jan Pazdziora created the Perl module version. 🌸


okay and that's the whole page!! this gem is living in perl v5.30.0, dated 2019-10-05, and she's still out here converting encodings like the main character she is. slay, periodt, happy reencoding bestie πŸ’–βœ¨πŸ¦‹πŸ’…πŸ‘‘

πŸ“¦ where this page comes from