uppercasing accented characters, mappings and \WORD
Hello, If I use the latin2 encoding (il2), \WORD works OK if I simply type accented characters. Under UTF-8, uppercasing \zcaron also works OK, but fails if I simply type 'ž'. I saw the \definemapping[il2] and I can write a mapping for windows-1250 regime as well, but how exactly is this done for unicode, where the character codes exceed 255? Could perhaps alternatively \WORD, \defineactivetoken or any other part of code be extended, so that \WORD would be happy with the typed accented characters as well? \Zcaron is already defined somewhere to be the uppercased \zcaron, so defining the same for every single regime/encoding manually seems redundant and error-prone. Thank you, Mojca (I don't have any editor to support latin2 under windows (except Mozilla), even for unicode vim and Windows are fighting against each other, so windows-1250 is the only reasonable thing that I can use comfortably.)
Mojca Miklavec wrote:
Hello,
If I use the latin2 encoding (il2), \WORD works OK if I simply type accented characters. Under UTF-8, uppercasing \zcaron also works OK, but
It fails because \zcaron expands prematurely. Perhaps this is an option: \def\definecharacter#1 #2 % {\ifundefined{#1}\unexpanded\setvalue{#1}... instead of \def\definecharacter#1 #2 % {\ifundefined{#1}\setvalue{#1}... (not sure if that would break stuff, but it seems sensible to me). Cheers, Taco
Taco Hoekwater wrote:
Mojca Miklavec wrote:
Hello,
If I use the latin2 encoding (il2), \WORD works OK if I simply type accented characters. Under UTF-8, uppercasing \zcaron also works OK, but
It fails because \zcaron expands prematurely. Perhaps this is an option:
\def\definecharacter#1 #2 % {\ifundefined{#1}\unexpanded\setvalue{#1}...
instead of
\def\definecharacter#1 #2 % {\ifundefined{#1}\setvalue{#1}...
(not sure if that would break stuff, but it seems sensible to me).
that will break other stuff (where we want/need expansion) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Mojca Miklavec wrote:
Hello,
If I use the latin2 encoding (il2), \WORD works OK if I simply type accented characters. Under UTF-8, uppercasing \zcaron also works OK, but fails if I simply type 'ž'. I saw the \definemapping[il2] and I can write a mapping for windows-1250 regime as well, but how exactly is this done for unicode, where the character codes exceed 255?
Could perhaps alternatively \WORD, \defineactivetoken or any other part of code be extended, so that \WORD would be happy with the typed accented characters as well? \Zcaron is already defined somewhere to be the uppercased \zcaron, so defining the same for every single regime/encoding manually seems redundant and error-prone.
i'm a bit puzzled, as long a something expands to a byte code it should work do you have a zipped example? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Mojca Miklavec wrote:
Hello,
If I use the latin2 encoding (il2), \WORD works OK if I simply type accented characters. Under UTF-8, uppercasing \zcaron also works OK, but fails if I simply type 'ž'. I saw the \definemapping[il2] and I can write a mapping for windows-1250 regime as well, but how exactly is this done for unicode, where the character codes exceed 255?
Could perhaps alternatively \WORD, \defineactivetoken or any other part of code be extended, so that \WORD would be happy with the typed accented characters as well? \Zcaron is already defined somewhere to be the uppercased \zcaron, so defining the same for every single regime/encoding manually seems redundant and error-prone.
Thank you, Mojca
(I don't have any editor to support latin2 under windows (except Mozilla), even for unicode vim and Windows are fighting against each other, so windows-1250 is the only reasonable thing that I can use comfortably.)
\startmapping[ec] \definecasemap 154 186 154 \definecasemap 186 186 154 \stopmapping \starttext \let\enabledmapping\empty % bypass optimization \enablemapping[ec] \def~{\zcaron} \WORD{\zcaron\space ~ º} \stoptext works ok here, so the solution is to complete the ec-texnansi-whatever mapping vectors .. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Mojca Miklavec
-
Taco Hoekwater