OnWorks favicon

kcc - Online in the Cloud

Run kcc in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command kcc that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator



kcc - Kanji code coverter with encoding auto detection


kcc [ -IOchnvxz ] [ -b bufsize ] [ file ] ...


kcc is a filter that reads file sequencially, converts kanji encodings and output to
stdout. If no file is specified, or specified - as filename, it read from stdin. You can
specify kanji encodings for input/output. However, kcc detect input encodig automatically,
if you don't specify input encoding.

Available kanji encodings are JIS (7 bit and/or 8 bit), Shift JISEUCDEC. For input
encoding, you can mix when these are pair of one of EUC DEC or Shift JIS and 7 bit JIS.
SI/SOESC(I are recognized as halfwidth of JIS.


-IO I for input kanji encoding¡¤O for output kanji encoding. When no input encoding
specified, it will be detected automatically, and if both of input/output aren't
specified, output encoding is 7 bit JIS.

You can specify one of the followings for the input encoding option, I.

e EUC(available with 7 bit JIS )
d DEC(available with 7 bit JIS )
s Shift JIS(available with 7 bit JIS )
j7 or k
7 bit JIS
8 8 bit JIS

You can specify one of the followings for output encoding option, O.

s Shift JIS
jXY or 7XY
7 bit JIS(usingSI/SO for JIS kana designation)
kXY 7 bit JIS(usingESC(I for JIS kana designation)
8XY 8 bit JIS

By XY in O option, You can specify which escape sequence used in JIS encoding. BJ
is default. Supplimental kanji designation is fixed to ESC$(D

X Kanji is designated by:
B ESC$B(JIS X0208-1983)
@ ESC$@(JIS X0208-1978)
+ ESC&@ESC$B(JIS X0212-1990)
Y Alpha Numerical is designated by:
J ESC(J(JIS Roman; JIS X0201)
H ESC(H(Swedish; strongly deprecated)

-v outputs result of input encoding detection to stderr.

-x Extension mode. By auto detection of input encodings, recognize user-defined
characters and extended character region ( out of range of EUC, undefined halfwidth
kana, control character, C1 area and/or extended character region Shift C1 JIS ).
Distinguish between DEC and EUC is done in this mode.

-z Shrink mode. Don't recognize halfwidth kana (except 7 bit JIS ) with input encoding
detection. With this option, accuracy of auto detection of input encodings becomes
much better for file without halfwidth kana.

-h Normally, When converted halfwidth kana to DEC , it becomes fullwidth Katakana.
With this option, it becomes Hiragana.

-n user-defined characters, extended characters and supplimental kanji characters
areconverted to fullwidth white box, and undefined region of halfwidth kana are
converted to halfwidth centered dot.

-b bufsize
specify buffer size. 8kbytes is default.

-c don't convert but check input encoding and print result to stdout. Different with
normal auto-detection, whole contents of file is checked. However, when
inconsistency of encodings is found, abort reading and print "data". Options
except -x¡¤-z are ignored.


% kcc -e file
Input encoding are detect automatically, and output is in EUC encoding.

% kcc -sj file1 file2
Two files in Shift JIS concatinated with converting to JIS.

% command | kcc -k+J
output of command are converted to JIS(JIS JIS X0208 JIS JIS Roman¡¤ESC(I Halfwidth
Kana JIS )

% kcc -c file
Encoding of contents of file is detected(no conversion)


Auto detection of input encoding is well done for normal case, however, it has the
following problems.

7 bit JIS is recognized by escape sequence in certain. EUC and DEC are the same (refered
as EUC series). Halfwidth kana of 8 bit JIS is the same as halfwidth kana of Shift JIS
(refered as Shift JIS series). However, EUC series and JIS , which are both 8 bit
encoding, are sharing the same regions widely. So, the problem in auto detection is
detection of these 2 encodings.

Detection of EUC series/Shift JIS series is done in line by line, When it is found that
it's not Shift JIS series, or it's not EUC series, encoding is determined. When
inconsistensy found, it will be treated as "data" and contents of output is not

While determined between EUC series/Shift JIS series after 8bit code found, conversions
are pending and put input data in buffer, however, buffer is fulled, it assumes it's EUC
series and forces to start conversion. Rationale. Usually, we can assume that documents
with kanji include JIS non-kanji or JIS first standard, it can be detected in certain if
it is Shift JIS , which does not share region with EUC. So if it can't be determined,
it's very likely to be EUC.

8 bit JIS and it has always even number of halfwidth kana sequences, then it will be
wrongly detected as EUC kanji. Be ceraful.

If input encoding doesn't have halfwidth kana, use -z and accuracy of detection become
much better. This is because shared region are restricted to area of JIS second

Extended region of Shift JIS user-defined area of EUC, control characters C1 of EUC,
undefined region of halfwidth kana of EUC are out of range of auto detection, so it will
fails to detect encodings if input has these characters. Use -x option to specify
extended mode, or specify input code.

Use kcc online using onworks.net services

Free Servers & Workstations

Download Windows & Linux apps

  • 1
    fre:ac - free audio converter
    fre:ac - free audio converter
    fre:ac is a free audio converter and CD
    ripper for various formats and encoders.
    It features MP3, MP4/M4A, WMA, Ogg
    Vorbis, FLAC, AAC, and Bonk format
    support, ...
    Download fre:ac - free audio converter
  • 2
    Matplotlib is a comprehensive library
    for creating static, animated, and
    interactive visualizations in Python.
    Matplotlib makes easy things easy and
    hard thing...
    Download Matplotlib
  • 3
    Write your chatbot logic once and
    connect it to one of the available
    messaging services, including Amazon
    Alexa, Facebook Messenger, Slack,
    Telegram or even yo...
    Download BotMan
  • 4
    Joplin is a free and open source
    note-taking and to-do application that
    can handle a large number of notes in
    Markdown format, organize them into
    notebooks and...
    Download Joplin
  • 5
    gerbv  a Gerber (RS-274X) viewer
    gerbv � a Gerber (RS-274X) viewer
    Gerbv is an open source Gerber file
    (RS-274X only) viewer. Gerbv lets you
    load several files on top of each other,
    do measurements on the displayed image,
    etc. ...
    Download gerbv � a Gerber (RS-274X) viewer
  • 6
    I/O performance Analysis Tool.
    Audience: Developers, Information
    Technology, Science/Research, System
    Administrators. User interface: Win32
    (MS Windows). Progr...
    Download Iometer
  • More »

Linux commands