It's a bug? first,last,rest in utf-8 string

Started by qinying, July 21, 2017, 06:34:44 PM

Previous topic - Next topic

qinying

Quote
> (set 'str "中文字符串")

"中文字符串"

> (first str)

"中"

> (last str) ;Should be "串"

"?

> (rest str)

"文字符串"

---------

> (set 'name "覃文运")

"覃文运"

> (first name) ;Should be "覃"

"覃文"

> (rest name) ;Should be "文运"

"运"

> (last name)

"运"

gekkonier

#1
Hi qinying, are you sure?



Im running this with UTF-8 version inside atom with plugin script (on win10, with utf-8 newLISP)


(set 'str "中文字符串")
(println str)
(println (first str))
(println (last str))
(println (rest str))
(println (explode str))


The output:
中文字符串


文字符串
("中" "文" "字" "符" "串")


That seems to be correct to me, isn't it?