Search the Community
Showing results for tags 'character'.
-
Hi all, I have written a simple routine to convert "Unicode"s to equivalent "character"s It is as following: (defun MT:Conv:Unichar->Char ;added: 94/12/12 (%unichar% / *ret*) (command "_.TEXT" '(0 0) "0.3" "0" %unichar%) (setq *ret* (cdr (assoc 1 (entget (entlast))))) (entdel (entlast)) *ret* ) Example: (MT:Conv:Unichar->Char "\\U+0647") -- returns --> "ه" Is there any way to define a function to do the reverse? I mean, it gets "character" as arguments and returns equivalent "Unicode"? I appreciate any help or suggestions.
-
Ascii and (vl-string-elt) give wrong answers!!
grandhougday posted a topic in AutoLISP, Visual LISP & DCL
I want to write a lisp that read a text from model space and replace some characters in it. for this work i iterate each character and take Ascii code of each one, then in if-else do replacement. in some chars it get wrong answers. for example in character "Þ" (latin capital letter thorn)(Ascii code:222 or Hex=\U+00DE). both (vl-string-elt "Þ" 0) and (Ascii "Þ") commands give me 92 as a resault of it ascii code i use doslib, but same problem exist. does any one know what's the problem?