Lisp HUG Maillist Archive

Unicode source files

Hi,

I have a source file with a symbol with a unicode character in the name. I found how to work with it in the IDE, but from the console I'm not sure what to do. What's the quickest way to work with Unicode so that (compile-file "my-utf8-encoded-file..lisp") will work?

Thanks,
Zach

Re: Unicode source files

Hi,

you should be able to pass the :external-format keyword argument to compile-file . Is that an option for you?

Regards,

Rainer


> Am 10.04.2018 um 17:19 schrieb Zach Beane <xach@xach.com>:
> 
> Hi,
> 
> I have a source file with a symbol with a unicode character in the name. I found how to work with it in the IDE, but from the console I'm not sure what to do. What's the quickest way to work with Unicode so that (compile-file "my-utf8-encoded-file.lisp") will work?
> 
> Thanks,
> Zach


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Unicode source files

For the record, we needed this functionality to support APL glyphs.

On Tue, Apr 10, 2018 at 11:21 AM, Rainer Joswig <joswig@lisp.de> wrote:
> Now the real question is: how to make the terminal-io stream to support
> UTF-8 when using a UTF-8 terminal?
>
> The last time this question came up was in 2017 and the answer from
> LispWorks seemed to be that this was not possible at that time.
>
> I guess this would be very useful to have! The question from Zach shows that
> already compiling a UTF-8 file may create problems when some symbol gets
> printed during compilation.
>
> Regards,
>
> Rainer
>
>
>
>
> Am 10.04.2018 um 19:14 schrieb Rainer Joswig <joswig@lisp.de>:
>
> When your terminal i/o is not UTF-8 during compilation, the printing of the
> symbol fails. So you could just tell Lisp not to print it:
>
>
>
> CL-USER 1 > (compile-file "/Users/joswig/Desktop/test.lisp" :external-format
> :utf-8)
> ;;; Compiling file /Users/joswig/Desktop/test.lisp ...
> ;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 1
> ;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
> ;;; Source level debugging is on
> ;;; Source file recording is  on
> ;;; Cross referencing is on
> ; (TOP-LEVEL-FORM 0)
> ;
>
> **++++ Error in
> Error: #\U+265C (of type CHARACTER) is not of type BASE-CHAR.
>   1 Skip compiling form.
>   2 (continue) Try compiling /Users/joswig/Desktop/test.lisp again.
>   3 Skip compiling /Users/joswig/Desktop/test.lisp.
>   4 (abort) Return to level 0.
>   5 Restart top-level loop.
>
> Type :b for backtrace or :c <option number> to proceed.
> Type :bug-form "<subject>" for a bug report template or :? for other
> options.
>
> CL-USER 2 : 1 > :top
>
> Compilation aborted.
>
> CL-USER 3 > setf *compile-print* nil
> NIL
>
> CL-USER 4 > (compile-file "/Users/joswig/Desktop/test.lisp" :external-format
> :utf-8)
> ;;; Compiling file /Users/joswig/Desktop/test.lisp ...
> ;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 1
> ;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
> ;;; Source level debugging is on
> ;;; Source file recording is  on
> ;;; Cross referencing is on
> #P"/Users/joswig/Desktop/test.64xfasl"
> NIL
> NIL
>
>
>
>
>
>
> Am 10.04.2018 um 18:52 schrieb Rainer Joswig <joswig@lisp.de>:
>
> For that see:
>
> http://www.lispworks.com/documentation/lw71/LW/html/lw-746.htm#59860
>
> *default-character-element-type*
>
> and related functionality...
>
> Am 10.04.2018 um 18:43 schrieb Zach Beane <xach@xach.com>:
>
> I get this:
>
>> (compile-file "/tmp/lwu.lisp" :external-format :utf-8)
>   ;;; Compiling file /tmp/lwu.lisp ...
>   ;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 1
>   ;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
>   ;;; Source level debugging is on
>   ;;; Source file recording is  on
>   ;;; Cross referencing is on
>   ; (TOP-LEVEL-FORM 0)
>   ; (DEFPACKAGE "LWU")
>   ; (TOP-LEVEL-FORM 2)
>   ; LWU::
>
>   **++++ Error in LWU::
>   Error: #\U+2032 (of type CHARACTER) is not of type BASE-CHAR.
>     1 Skip compiling form.
>     2 (continue) Try compiling /tmp/lwu.lisp again.
>     3 Skip compiling /tmp/lwu.lisp.
>     4 (abort) Return to level 0.
>     5 Return to top-level loop.
>     6 Return from multiprocessing.
>
>   Type :b for backtrace or :c <option number> to proceed.
>   Type :bug-form "<subject>" for a bug report template or :? for other
> options.
>
> On Apr 10, 2018, at 12:34 PM, Rainer Joswig <joswig@lisp.de> wrote:
>
> See also:
>
> http://www.lispworks.com/documentation/lw71/LW/html/lw-203.htm#24631
>
>
>
> Am 10.04.2018 um 18:16 schrieb Rainer Joswig <joswig@lisp.de>:
>
> Hi,
>
> you should be able to pass the :external-format keyword argument to
> compile-file . Is that an option for you?
>
> Regards,
>
> Rainer
>
>
> Am 10.04.2018 um 17:19 schrieb Zach Beane <xach@xach.com>:
>
>
> Hi,
>
>
> I have a source file with a symbol with a unicode character in the name. I
> found how to work with it in the IDE, but from the console I'm not sure what
> to do. What's the quickest way to work with Unicode so that (compile-file
> "my-utf8-encoded-file.lisp") will work?
>
>
> Thanks,
>
> Zach
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
>
>
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Unicode source files

Unable to parse email body. Email id is 14780

Re: Unicode source files

Unable to parse email body. Email id is 14781

Re: Unicode source files

Unable to parse email body. Email id is 14782

Updated at: 2020-12-10 08:30 UTC