Function Not Seeing Special Character In String

Function Not Seeing Special Character In String

DGCSCAD
Collaborator Collaborator
351 Views
5 Replies
Message 1 of 6

Function Not Seeing Special Character In String

DGCSCAD
Collaborator
Collaborator

For some reason when I run a function containing this code fragment:

 

(setq istest (wcmatch str_list3 "*Â*"))

 

Using this string (str_list3): "TEST®"

 

...it's coming back NIL, but when I paste that same code fragment to the command line with everything else in place, it returns T.

 

Everything else around it is working as it should be, so I'm guessing the LISP interpreter uses a different character set than the AutoCAD API for the command line...?

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Accepted solutions (1)
352 Views
5 Replies
Replies (5)
Message 2 of 6

pbejse
Mentor
Mentor

@DGCSCAD wrote:

For some reason when I run a function containing this code fragment:

(setq istest (wcmatch str_list3 "*Â*"))

Using this string (str_list3): "TEST®"

...


Its coming out T however i run that snippet, can you give us more info?

0 Likes
Message 3 of 6

paullimapa
Mentor
Mentor

what happens if you precede with `

(wcmatch str_list3 "*`Â*")


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 4 of 6

komondormrex
Mentor
Mentor
Accepted solution

try to use unicode notation in (setq istest (wcmatch str_list3 "*\U+00c2*")) for "Â" char.

Message 5 of 6

DGCSCAD
Collaborator
Collaborator

@paullimapa wrote:

what happens if you precede with `

(wcmatch str_list3 "*`Â*")


Still returns NIL.

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Message 6 of 6

DGCSCAD
Collaborator
Collaborator

@komondormrex wrote:

try to use unicode notation in (setq istest (wcmatch str_list3 "*\U+00c2*")) for "Â" char.


That worked! Thank you!

AutoCad 2018 (full)
Win 11 Pro
0 Likes