Nordics (eg. "ä", "ö", "å") usage in lisp

Buzz0m
Collaborator
Collaborator

Nordics (eg. "ä", "ö", "å") usage in lisp

Buzz0m
Collaborator
Collaborator

Hi,
I've discovered that a certain lisp that creates layers in which there are nordic characters (ä/ö/å) works flawlessly in C3D2022 but not in previous versions (I haven't tried 2021). The issue is that the nordics are converted to other character combinations, which ofc is not acceptable when the layer names should be according to certain standards.

I'm a wondering if there is any kind of setting or switch in lisp files (eg. character coding) or in the users settings that affects the way Autocad handles special characters.

 

Thanks for any help!
- F

 

0 Likes
Reply
Accepted solutions (1)
555 Views
8 Replies
Replies (8)

cadffm
Consultant
Consultant
Accepted solution

Older? You talk about "older than version 2020" or?

Answer: No,

you created incompatible programs, incompatible with  all older versions and

(also incompatible with 2020 and newer if LISPSYS is set to 0 - what is generally the best default for common users , because older lisp programs can stop working with this setting)

 

 

Sebastian

0 Likes

Buzz0m
Collaborator
Collaborator

"Older" or "previous" as in all released version before the version 2022. The lisp I put together works as intended for 2022 but not for other versions that I've tested (2018, 2020) and made the conclusion that 2022 is somehow different. The lispsys help site confirmed this (thanks @cadffm for pointing it out):

"LISPSYS=0: Visual LISP IDE (VL IDE) is set as the default editor, however AutoLISP functions don't fully support Unicode characters."

https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2021/ENU/AutoC...

The lisp runs on previous versions but just fails when it comes to the nordics characters. Is there any known way of working around this issue?

0 Likes

cadffm
Consultant
Consultant

Again: No

But we need to know you code, otherwise we have to guess.

For example: Ä and Ö shouldn't be a problem so lang you are inside of AutoCAD.

(read/import data from external source is another thing and dependend of county settings and copedpages)

The real nordic å I didn't check (ä ö ü umlauts are usual in german too, so I know it for umlauts)

 

>>"The lispsys help site confirmed this"

Yes and No, the site confirmed that is not supported while Lispsys is set to 0,

but if you set Lispsys to 1 or 2 it should work - since Version 2021 (and if you set 2022 to 0, it also not working).

 

>>"v I've tested (2018, 2020)"

That's it. LispSys started in version2021, all older versions are similar tio Lispsys=0

 

Share your data and external files to safe time for long explainations.

Sebastian

0 Likes

fatal.error
Advocate
Advocate

Are you aware of EXTNAMES System Variable?

 

Controls the characters accepted for the names of blocks, dimension styles, layers, and other named objects. 

 

ValueDescription
0

Uses Release 14 parameters, which limit names to 31 characters in length. Names can include the letters A to Z, the numerals 0 to 9, and the special characters dollar sign ($), underscore (_), and hyphen (-).

1

 

Uses Release 2000 (and later) parameters. Names can be up to 255 characters in length, and can include the letters A to Z, the numerals 0 to 9, spaces, and any special characters not used by the operating system and the product for other purposes.

 

 

 

0 Likes

Buzz0m
Collaborator
Collaborator

No at least I wasn't. But my settings was at "1". Thanks for point out that variable!

0 Likes

Buzz0m
Collaborator
Collaborator

Sooooo. Tell me if this really could be the root cause: the character coding of the lisp-file itself? I'm using notepad++ and changed the character coding from UTF-8 to ANSI. Now it seems my code runs fine.

 

Here is a bit of troubleshooting I already typed before I tried the above mentioned solution.

////////

Ok guys... tell me if this is how lisps should handle nordics? I retested my code and when I pass my layernames to other functions they seem to work fine.

I have a simple princ statement which when inputted into the console works fine but when I run it via lisp it outputs weird charactercombinations.

(defun c:SW_RJ_aakkoset (/)
	(princ "ääääåååööööö \n")
)

 This is what comes out at my end on the console when fire off the lisp:


///

Command: SW_RJ_AAKKOSET
ääääåååööööö
"ääääåååööööö \n"

////

 

 

 

 

0 Likes

cadffm
Consultant
Consultant

>>"he character coding of the lisp-file itself?"

Yes


>>" (princ "ääääåååööööö \n")"

That's no Unicode problem.

Sebastian

0 Likes

cadffm
Consultant
Consultant

Tested with ACAD2019 for you:

Befehl: SW_RJ_AAKKOSET
ääääåååööööö
"ääääåååööööö \n"

Befehl:

 

Do you have a new PC? / new OS?

Please check out and disable this beta-feature (just a shot in the dark - i am not a Pro in these things:

https://docs.microsoft.com/en-us/answers/questions/587680/where-can-i-find-34beta-use-unicode-utf-8-...

 

Country setting is okay?

 

Sebastian

0 Likes