ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Giuseppe Bilotta" <oblomov@freemail.it>
Cc: "ConTeXt" <ntg-context@ntg.nl>
Subject: Re: ROT13 and alike
Date: Tue, 20 Feb 2001 16:58:33 +0100	[thread overview]
Message-ID: <000101c09b8a$38ee3020$a3ccfea9@nuovo> (raw)
In-Reply-To: <3.0.6.32.20010219112004.0180d100@server-1>

The scrambling for the society was the following:

\startmapping[carbon]
   \definecasemap  65  79  79  % a -> o
   \definecasemap  66  80  80  % b -> p
   \definecasemap  67  71  71  % c -> g
   \definecasemap  68  84  84  % d -> t
   \definecasemap  69  73  73  % e -> i
   \definecasemap  70  86  86  % f -> v
   \definecasemap  71  67  67  % g -> c
   \definecasemap  72  72  72  % h -> h
   \definecasemap  73  69  69  % i -> e
   \definecasemap  74  74  74  % j -> j
   \definecasemap  75  75  75  % k -> k
   \definecasemap  76  82  82  % l -> r
   \definecasemap  77  78  78  % m -> n
   \definecasemap  78  77  77  % n -> m
   \definecasemap  79  65  65  % o -> a
   \definecasemap  80  66  66  % p -> b
   \definecasemap  81  81  81  % q -> q
   \definecasemap  82  76  76  % r -> l
   \definecasemap  83  90  90  % s -> z
   \definecasemap  84  68  68  % t -> d
   \definecasemap  85  85  85  % u -> u
   \definecasemap  86  70  70  % v -> v
   \definecasemap  87  87  87  % w -> w
   \definecasemap  88  88  88  % x -> x
   \definecasemap  89  89  89  % y -> y
   \definecasemap  90  83  83  % z -> s
   \definecasemap  97 111 111  % A -> O
   \definecasemap  98 112 112  % B -> P
   \definecasemap  99 103 103  % C -> G
   \definecasemap 100 116 116  % D -> T
   \definecasemap 101 105 105  % E -> I
   \definecasemap 102 118 118  % F -> V
   \definecasemap 103  99  99  % G -> C
   \definecasemap 104 104 104  % H -> H
   \definecasemap 105 101 101  % I -> E
   \definecasemap 106 106 106  % J -> J
   \definecasemap 107 107 107  % K -> K
   \definecasemap 108 114 114  % L -> R
   \definecasemap 109 110 110  % M -> N
   \definecasemap 110 109 109  % N -> M
   \definecasemap 111  97  97  % O -> A
   \definecasemap 112  98  98  % P -> B
   \definecasemap 113 113 113  % Q -> Q
   \definecasemap 114 108 108  % R -> L
   \definecasemap 115 122 122  % S -> Z
   \definecasemap 116 100 100  % T -> D
   \definecasemap 117 117 117  % U -> U
   \definecasemap 118 102 102  % V -> V
   \definecasemap 119 119 119  % W -> W
   \definecasemap 120 120 120  % X -> X
   \definecasemap 121 121 121  % Y -> Y
   \definecasemap 122 115 115  % Z -> S
\stopmapping

\def\CRB#1{{\enablemapping[carbon]\lowercase{#1}}}

\useencoding[windows]
\starttext

\def\text{Prova. Ecco dell'altro! Accenti? Sì, grazie! O s\`\i, grazie,
o perché no? E perch\'e no?}
\text\par
\expandafter\CRB\expandafter{\text}\par

\stoptext

But accents in active chars are not dealt with, nor is \i converted to e,
nor is e converted to \i when accented. How can these details be taken
care of?

Second thing: is it possible to ensure that multiple paragraphs
are typeset scrambled? A \startCRB ... \stopCRB pair?

Finally: is it possible to implement scrambling "natively"?

\startscrambling[rot13]
 \swaps a to m  n to z
 \swaps A to M  N to Z
% also \swaps  <num> to <num>  <num> to <num>, checking for same length
\stopscrambling

\startscrambling[carbonar]
 \swap a o
 \swap b p
 ...
\stopscrambling

\usescrambling[name]

allowing \lowercase to behave the right way even when scrambling is active,
and working correctly with accents, both in active form (ì) and normal form (\'e)

Thank you for your attention,

Giuseppe Bilotta


  parent reply	other threads:[~2001-02-20 15:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-16 18:15 Giuseppe Bilotta
2001-02-17 18:30 ` Taco Hoekwater
2001-02-18 12:50   ` Giuseppe Bilotta
2001-02-19 11:19     ` Hans Hagen
2001-02-19 10:20 ` Hans Hagen
2001-02-19 22:45   ` Giuseppe Bilotta
2001-02-20 11:29     ` Hans Hagen
2001-02-20 15:58   ` Giuseppe Bilotta [this message]
2001-03-12 20:37     ` Hans Hagen
2001-03-14  0:26       ` Re[2]: " Giuseppe Bilotta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000101c09b8a$38ee3020$a3ccfea9@nuovo' \
    --to=oblomov@freemail.it \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).