\kcatcode`あ=18
\def\xA{あ}\let\yA=あ
\kcatcode`あ=17
\def\xB{あ}\let\yB=あ
\kcatcode`あ=16

\message{\ifcat あ\xA Y\else N\fi}
\message{\ifcat あ\yA Y\else N\fi}
\message{\ifcat あ\xB Y\else N\fi}
\message{\ifcat あ\yB Y\else N\fi}

\message{\if    あ\xA Y\else N\fi}
\message{\if    あ\yA Y\else N\fi}
\message{\if    い\xA Y\else N\fi}
\message{\if    い\yA Y\else N\fi}

\ifx\ucs\undefined\else
  \kcatcode"100=16
  \message{upTeX}
  \def\xA{Ā}% U+0100
  \def\xB{ā}% U+0101
  \message{\if   \xA\relax Y\else N\fi}
  \message{\if   \xB\relax Y\else N\fi}
  \message{\ifcat\xA\relax Y\else N\fi}
  \message{\ifcat\xB\relax Y\else N\fi}
\fi
\end


