Re: Accented letters




aliba <linden@xxxxxxxxxx> wrote:

Date: Tue, 07 Aug 2007 05:37:24 -0700

How can I code accented letters of foreign languages - e.g., in
French, "=E0", "=E9", "=F4", ","=F9", etc. - in Poplog Prolog?

The same question applies to the apostrophe sign (ASCII code 39).

So far, I have been unable to scan these special characters,
which are recognized without difficulty by tokenizers implemented in
other Edingurgh compatible Prologs, in Poplog Prolog.

I thought this was going to be tricky, but it turns out that Poplog
Prolog uses the same conventions for expressing ascii codes in
strings and atoms as Poplog Pop11 does, as described in the Pop-11
help file:

HELP ASCII

All the special codes start with backslash "\". Some follow unix
conventions, e.g.

ASCII Typed as Represents
32 `\s` the code for a space
13 `\r` the code for a carriage return
10 `\n` the code for a line feed
8 `\b` the code for a back space
9 `\t` the code for a tab
27 `\e` the code for an escape
92 `\\` the code for the backslash itself

In a string (or Prolog atom or string) the string quote character
(apostrophe) is represented by

\'

Control characters:

`\^a` or `\^A` is CTRL-A (ASCII 1)
`\^b` or `\^B` is CTRL-B (ASCII 2)
etc.

A further convention allowed in strings is the representation of an
ASCII code by an integer between the brackets in \(..). E.g.

'\(65)\(66)' =>

is equivalent to

'AB' =>


Other characters can be represented the same way, e.g.
In Poplog prolog

?-write(' \(224) \(233) \(244) \(249) \' \(39) ').

produces

à é ô ù ' ' yes

I don't know whether the first four characters will survive posting
view the news system, but they should correspond to:

=E0 =E9 =F4 =F9

Aaron
http://www.cs.bham.ac.uk/~axs/

.



Relevant Pages

  • Re: Casting array to string
    ... both sequences! ... want to convert a vector into a string (a vector of characters). ... If you want to consider the ASCII code, ...
    (comp.lang.lisp)
  • Re: Encoding.Default and Encoding.UTF8
    ... Anybody knows are there any characters in French and Spanish greater than ... 128 ASCII code? ... They're likely to be the same for any string ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Encoding.Default and Encoding.UTF8
    ... Anybody knows are there any characters in French and Spanish greater than ... 128 ASCII code? ... They're likely to be the same for any string ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... put them in stupid places. ... Programming is difficult (as you must surely appreciate, ... > strings will be in the range 1...1000 characters. ... impose an artificially small limit on string length." ...
    (comp.programming)