Accented letters does not print/display correctly


I have multiple lisps that prints some text in Bricscad and while some of them displays the string correctly with accented letters, some other call won't display correctly.

As an example. Take a look at the attached picture.
The princ call displayed correctly while the alert call did not.

Some one knows how to avoid such a mess?

Can it be related to the text editor? I use Notepad++ and the regular Windows Notepad to edit my lisps.



  • 1LandSurveyor
    edited August 9

    Found my answer.

    I now think that all «PRINC» statements displays accented letters correctly.

    Other functions like (command "Text"...) or (Alert ...) require Unicode. Thanks to

    Example : (Alert "Acc\\U+00E8s") ; will display the word «Accès».
    while (princ "Accès") ; will correctly display the word «Accès».

  • That is not the full story. This is (also) related to the encoding used for the Lisp file.

  • Ohhh that's interesting. How can i select the right encoding and prevent the need to use Unicode?

  • In Notepad++:
    Encoding -> Convert to ANSI

  • 1LandSurveyor
    edited August 11

    You were totally right! Worked like a charm.
    The default encoding was UTF-8 instead of ASCII...

    Thanks a lot @Roy Klein Gebbinck

    Watch out for this, people :wink:

  • Torsten Moses
    edited August 17

    Dear All,

    actually, both BricsCAD + AutoCAD (>= 2021/2022 ?) can handle LISP files with UTF encoding ...
    problem is, that virtually all editors save as UTF-8 WITHOUT the BOM marker;
    as consequence, application code has no way to distinguish whether a text file is plain "ANSI" or "UTF-8 without BOM";

    For UTF-16, the BOM is strictly required, for UTF-8 the BOM is optional ... clear design fault with UTF-8, straight from beginning :-(
    So still best + safest approach : never use UTF formats for AutoLISP, but plain ANSI (even when it sometimes requires the Unicode encryption via "\U+"

    many greetings !

  • Thanks a lot @Torsten Moses! Interesting.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!