\def\eng#1{\clearocplists\fontfamily{\rmdefault}\selectfont{}#1}
\def\english{\clearocplists\fontfamily{\rmdefault}\selectfont}

\def\externalfont{\fontfamily{\rmdefault}\selectfont}
    \ocp\bengU=bangla-uni01
     \ocp\bengF=bangla-uni2bang

     \ocplist\bengCTP=
    \addbeforeocplist 1 \bengU
     \addbeforeocplist 2 \bengF
     \nullocplist

\newcount\beng@chnum
%
\newcommand*\do@beng@catcodes{%
  \beng@chnum=0
  \loop\catcode\beng@chnum=11
    \ifnum\beng@chnum<12 \advance\beng@chnum by1
    \repeat
  \beng@chnum=14
  \loop\catcode\beng@chnum=11
    \ifnum\beng@chnum<31 \advance\beng@chnum by1
    \repeat
  \catcode127=11 }
% setup for utf-8 input %
\ocp\UtfEightInput=inutf8
\AtBeginDocument{
  \DefaultInputMode onebyte
  \InputMode currentfile onebyte
  \DefaultInputTranslation onebyte \UtfEightInput
  \InputTranslation currentfile \UtfEightInput}



\long\def\beng{\do@beng@catcodes
\fontencoding{U}\fontfamily{bang}\selectfont\catcode`\~=11
\pushocplist\bengCTP}





