Jump to content

A question about special characters such as "°"


Recommended Posts

Posted

Hello, this is my first post here & I'm very new to autolisp, so forgive me if I am omitting some important details.
I'm trying to find out why (maybe) strcat is conjuring an "Â" that doesn't appear to be in any of the variables before it.

It is appearing after (itoa intd) & before "°".

 

(setq nbrg2 (strcat (itoa intd) "°" mint "'" sec (chr 34)))

225°00'00" is output for example.


I think it has something to do with the ° symbol but I'm not sure why.
(chr 248) will output ø instead of °.
I have found out that using "\260" will work and output the ° symbol.

If anyone could explain what I should be doing with special characters or point me to some learning resource that would be greatly appreciated ^^

Posted

I think it has to do with the font your using. not all character numbers are the same in each font. to find the correct number use the following

 

(ascii "°")

 

mine its 176 so then use that number with (chr

 

(setq nbrg2 (strcat (itoa intd) (chr 176) mint "'" sec (chr 34)))

 

This will display all your character numbers of the current font.

https://www.cadtutor.net/forum/topic/75383-text-ascii/?do=findComment&comment=596047

 

  • Like 2
Posted

(setq nbrg2 (strcat (itoa intd) "%%D" mint "'" sec (chr 34)))

Posted

Inside Windows Fonts you can check each character to find its character code. As mentioned some fonts have different characters for same number.

  • Like 2
Posted

Thank you all for the solutions and explanations :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...