I've added a play-script at:
http://www.jsoftware.com/jwiki/UnicodeGettingStarted
So now you can look at the classic "superasciis" like this, and see
what they represent nowadays as unicode code-points:

   cu '~'
~ U+007E 126
   nx 129
 U+007F 127
€ U+0080 128
 U+0081 129
‚ U+0082 130
...etc...

... qui comprend 'ç' et ses amis.

Which is _not_ what you get with: 127}. a.

BTW, playing with this play-script, I hadn't realised how many bizarre
APL characters there were! Did they all ever get implemented?

@Bill,
Thanks for pointing me at the stdlib support for unicode. Some of them
look really useful, like toutf8. I'm not sure I'll abandon my own
utilities just yet, though.

Ian


2010/11/27 Björn Helgason <[email protected]>:
> To use the french chars in the example from your page
>
>
>
>   3 u: 7 u: 'àâêéèêëîïôöùç'
> 224 226 234 233 232 234 235 238 239 244 246 249 231
>    require'convert'
> HFR=.hfd 224 226 234 233 232 234 235 238 239 244 246 249 231
> e0
> e2
> ea
> e9
> e8
> ea
> eb
> ee
> ef
> f4
> f6
> f9
> e7
>
>
> u:>".each(<'16b'),each ": each hfd each 224 226 234 233 232 234 235 238 239
> 244 246 249 231
> àâêéèêëîïôöùç
>
>
> 2010/11/27 Ian Clark <[email protected]>
>
>> My colleagues on the list have given you extremely cryptic answers,
>> albeit accurate -- and probably complete.
>>
>> But unicode is puzzling when you first meet it, especially utf-8, a
>> standard for embedding "unicode" characters like 'ç' as multi-byte
>> substrings in (what is otherwise) ascii text. So puzzling, in fact,
>> that I wrote myself these notes:
>>   http://www.jsoftware.com/jwiki/UnicodeGettingStarted
>> to remind myself about it when I came to deal with it all over again.
>>
>> And maybe to help another beginner.
>>
>> They'll have you believe that j602 is unicode-savvy, making ascii vs
>> unicode considerations invisible to the coder. Just like numbers. :-)
>> And that's the way it feels to me these days. But that wasn't how it
>> felt when I started out.
>>
>> You can indeed arrange for (a.) to handle  'ç' and its sisters in a
>> 1-byte fashion, in the way you ask. (128{a.) to (255{a.) are unused,
>> and can be used as placeholders for extended Latin characters.
>> Allocate them how you like, and convert them to the glyph you wish to
>> see only when required for output. This permits you to code in a way
>> you're familiar with. It is the way I started out, when I had a
>> similar coding task.
>>
>> But soon you will find it better to standardize on wchar
>> ("wide-characters", ie 2-byte ones) for strings containing French
>> text. I use:
>>   wide=: 2 u: 7 u: ]
>> to force a string into wchars, even if it contains only alphanumeric.
>> This may be overkill, but one can grow heartily sick of looking up the
>> left argument to (u:).
>>
>> And datatype_z_ will tell you what form your string is currently being
>> held in, viz 'literal' (which includes utf-8) or 'unicode'.
>>
>> All parts of j602 have been enhanced to accommodate both utf-8 and
>> wchars, including button captions in wd. But a beginner can be tricked
>> into thinking that this is not the case, as when buttons show black
>> squares at runtime. The answer is: specify another font, ie one which
>> actually has glyphs for the black squares. Courier New is a safe
>> choice because it has glyphs for most (Western) code points, including
>> APL -- but oh-so-ugly!
>>
>> Ian Clark
>>
>>
>> On Fri, Nov 26, 2010 at 10:27 PM, Eric Morlet <[email protected]> wrote:
>> > While writing a J application that will handle people names I  would like
>> to know
>> > if there is a way for me to have a character set (a.) that would  include
>> the
>> > french accented characters:
>> >
>> >  à â ê é è ê ë î ï ô ö ù ç
>> >
>> >  While scanning character arrays I have:
>> >
>> > a. i. 'ç'
>> >   195 167
>> >
>> > 'x' = 'x'               NB.     OK
>> >   1
>> >
>> >  but:
>> >
>> > 'ç' = 'ç'                  NB.    !!!
>> >   1 1
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> >
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
> --
> Björn Helgason, Verkfræðingur
> Fornustekkum II
> 781 Hornafirði,
> t-póst: [email protected]
> gsm: +3546985532
> sími: +3544781286
> http://groups.google.com/group/J-Programming
>
>
> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
>
> góður kennari getur stigið á tær án þess að glansinn fari af skónum
>          /|_      .-----------------------------------.
>         ,'  .\  /  | Með léttri lund verður        |
>     ,--'    _,'   | Dagurinn í dag                     |
>    /       /       | Enn betri en gærdagurinn  |
>   (   -.  |        `-----------------------------------'
>   |     ) |         (\_ _/)
>  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
>   `. )----'        (")_(") ☃☠
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to