On 4 April 2014 23:25, Waldek Hebisch <[email protected]> wrote:
> Bill Page wrote:
>>
>> In any case I now have a patch to the texmacs package in FriCAS that
>> does the utf-8 to Cork conversion. I have attached a draft FriCAS
>> patch, the modified fricas-input plugin and an example document (also
>> in PDF format).
>>
>
> Bill, the 'utf8' function look strange: if the string is not
> a Cork enconding of something, then it will silently produce
> garbage 0 code.  If you do not want to signal errors Unicode
> has special "replacement character" which is intended be
> a marker for things which are incorrectly encoded.  So
> use this character instead.
>

This function is not used in the code.  I will delete it.

> Also, you use directly character codes inside the file.  This
> may look nicer, but will cause build problems on some
> systems.  Better use numeric codes.  Also, FriCAS has
> 'ucodeToString' function to produce Unicode String from
> a single Unicode charater code.  It is supposed to work
> even if underlying Lisp does not support Unicode
> (in such case it will produce multibyte string containing
> Utf-8 encoding of the character).  So, use 'ucodeToString'
> and numeric codes in the table.
>

OK, I can use numeric codes in the table. Is it ok to include uft-8
characters in spad comments?

Concerning ucodeToString: I am not so clear on the purpose. Do you
mean use this function to convert to string instead of coercion? E.g.

+    cork:            Character -> S
...
     cork(x) ==
          for i in Cork repeat
            if i.unicode.1 = x then return i.corkcode
-         x::String
+        ucodeToString x

    utf2cork str ==
      concat [cork i for i in entries str]

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to