Lisp HUG Maillist Archive

Unicode concatenate problem

LW 5.1, Windows

what am I doing wrong? Jens


CL-USER 1 > (setq japanese-string "センサ外形寸法")
"センサ外形寸法"

CL-USER 2 > (type-of japanese-string)
SIMPLE-TEXT-STRING

CL-USER 3 > (concatenate 'string japanese-string japanese-string)

Error: #\セ is not of type BASE-CHAR.
  1 (abort) Return to level 0.
  2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other 
options

CL-USER 4 : 1 > 


Re: Unicode concatenate problem

On 4/3/08, Jens Teich <info@jensteich.de> wrote:
>
>  LW 5.1, Windows
>
>  what am I doing wrong? Jens

The default element type of strings in lispworks is the value of
*default-character-element-type* which defaults to base-char.

try (set-default-character-element-type 'character)

sean


Re: Unicode concatenate problem


"Sean Ross" <rosssd@gmail.com> writes:
> try (set-default-character-element-type 'character)

Yes, that will fix it.

  http://article.gmane.org/gmane.lisp.lispworks.general/7381

I, for one, think that LispWorks should have a smarter
concatenate but this is a good workaround.

Cheers,
Chris Dean



Re: Unicode concatenate problem

Le 3/04/08 7:49, « [NOM] » <[ADRESSE]> a écrit :

> CL-USER 1 > (setq japanese-string "センサ外形寸法")
> "センサ外形寸法"
> 
> CL-USER 2 > (type-of japanese-string)
> SIMPLE-TEXT-STRING
> 
> CL-USER 3 > (concatenate 'string japanese-string japanese-string)

You can also do :

(concatenate '16-bit-string japanese-string japanese-string)

Best

Denis

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Updated at: 2020-12-10 08:43 UTC