# [Cjk] Problem with CJKchar

Werner LEMBERG wl at gnu.org
Fri Nov 23 22:25:53 CET 2007

> What I wanted to say was, that I would like to keep the encoding of
> the source files in ASCII (with some latin1),

With other words: you want to use latin-1 encoding for your file, and
single characters should be specified with a given encoding and
character codes, right?

> and therefore only to introduce the Japanese characters during the
> latex compilation, using the \CJKchar command.

Then I suggest to define a new command which switches the encoding
temporarily, as shown in the attached example.  Note that
\begin{CJK}' and \end{CJK}' (as with all environment commands) is
the same as \CJK' and \endCJK', respectively.

However, the right' approach today is to use UTF-8 encoding.  Have a
look at the CJKutf8.tex example file how this can be done (and please

Werner

======================================================================

\documentclass{article}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{german}

\usepackage[encapsulated]{CJK}

\newcommand{\Jap}[2]{%
\CJK[dnp]{JIS}{min}%
\CJKchar{#1}{#2}%
\endCJK
}

\begin{document}

\tableofcontents

\section{Deutsch und \Jap{"46}{"7C}\Jap{"4B}{"5C}\Jap{"38}{"6C}
in einem Dokument}

Grüezi miteinand'!

\Jap{"3A}{"23}\Jap{"46}{"7C}\Jap{"24}{"4F}

\end{document}

`