用法
评论
建议
取 消
确 定
(defun string:s2l-ansi (str / lst-str h% res) "字符串转字byte or word 整数值列表。\n当小于128时,单字节,当两个连续的大于128时,双字节值。用于转换非英文字串时防止重码。\n当AutoCAD2021且lispsys=1时,返回 unicode 码。" (if (<= 1 (getvar "lispsys")) (vl-string->list str) (progn (setq h% 0) (setq res (quote nil)) (foreach byte% (vl-string->list str) (cond ((and (= 0 h%) (or (< byte% 128) (> byte% 255))) (setq res (cons byte% res))) ((and (= 0 h%) (> 256 byte% 127)) (setq h% byte%)) ((or (and (> 170 h% 127) (< byte% 128)) (and (> 256 h0 170) (> 64 byte%))) (setq res (cons h% res)) (setq res (cons byte% res)) (setq h% 0)) ((or (and (> 170 h% 127) (> 256 byte% 127)) (and (> 256 h% 170) (> byte% 64))) (setq res (cons (+ (lsh h% 8) byte%) res)) (setq h% 0)))) (reverse res))))
函数库使用说明
应用包
技术支持
统计信息
函数库规模: 747 个
函数库类别: 52 种
上传记录
刷新