Lisp HUG Maillist Archive

Concatenate character encoding issue

I have the following code:

(setf dirname
    (concatenate 'string 
                           (coerce dirname 'text-string)
                           (coerce dp ‘text-string) "/"))

I get the following error with a certain directory input name:

    Error: #\– (of type CHARACTER) is not of type BASE-CHAR.

The filename is:  BLADE X3 WORKStation – SUSE Studio,1_files

The ‘dp’ is coming from the result of #’pathname-directory.
‘dirname’ is simply the result of concatenating the dp parts together with a “/“.

Any suggestions to help deal with this character range encoding issue?  

—
Burton Samograd

—
Burton Samograd
BusFactor1@gmail.com http://BusFactor1.ca
http://twitter.com/BusFactor1 http://facebook.com/BusFactor1 http://instagram.com/BusFactor1

Re: Concatenate character encoding issue

Hi Burton,

Have a look at http://www.lispworks.com/documentation/lw70/LW/html/lw-191.htm ,
which explains the various string and character types in Lispworks 7.

I guess the summary is: it helps to use CHARACTER as your default character
element type, e.g.

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

Arthur

------

On Sat, 14 Jan 2017 16:56:48 +0100, BusFactor1 Inc. <busfactor1@gmail.com> wrote:

> I have the following code:
>
>
> (setf dirname
>     (concatenate 'string                           (coerce dirname 'text-string)
>                            (coerce dp ‘text-string) "/"))
>
>
>
> I get the following error with a certain directory input name:
>
>
>     Error: #\– (of type CHARACTER) is not of type BASE-CHAR.
>
>
> The filename is:  BLADE X3 WORKStation – SUSE Studio,1_files
>
>
> The ‘dp’ is coming from the result of #’pathname-directory.
> ‘dirname’ is simply the result of concatenating the dp parts together with a “/“.
>
>
> Any suggestions to help deal with this character range encoding issue?  
>
> —
> Burton Samograd
>
>
>   —
> Burton Samograd
> BusFactor1@gmail.com http://BusFactor1.ca
> http://twitter.com/BusFactor1 http://facebook.com/BusFactor1 http://instagram.com/BusFactor1
>
>
>
>
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Concatenate character encoding issue

Clarification: your minus character is not an ordinary ASCII minus, so
it does not belong to base-char.  For sure you can check it with
char-code.

If you need such chars (e.g. you do not generate them yourselves), use
Lemmens suggestion about changing default character set.

Regards

ZJ
 

Dnia 2017-01-14, sob o godzinie 07:56 -0800, BusFactor1 Inc. pisze:
> I have the following code:
> 
> 
> (setf dirname
>     (concatenate 'string 
>                            (coerce dirname 'text-string)
>                            (coerce dp ‘text-string) "/"))
> 
> 
> I get the following error with a certain directory input name:
> 
> 
>     Error: #\– (of type CHARACTER) is not of type BASE-CHAR.
> 
> 
> The filename is:  BLADE X3 WORKStation – SUSE Studio,1_files
> 
> 
> The ‘dp’ is coming from the result of #’pathname-directory.
> ‘dirname’ is simply the result of concatenating the dp parts together
> with a “/“.
> 
> 
> Any suggestions to help deal with this character range encoding
> issue?  
> 
> 
> —
> Burton Samograd
> 
> 
> —
> Burton Samograd
> BusFactor1@gmail.com http://BusFactor1.ca
> http://twitter.com/BusFactor1 http://facebook.com/BusFactor1
> http://instagram.com/BusFactor1
> 



_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Concatenate character encoding issue

Hi,

you have coerced the strings to type LW:TEXT-STRING.

Then it would be a good idea to use this type in CONCATENATE, too:

(concatenate 'text-string ...)

Documentation:   text-string is the type of strings that can hold any character...

Regards,

Rainer


> Am 18.01.2017 um 12:39 schrieb zbyszek <zbyszek@mimuw.edu.pl>:
> 
> Clarification: your minus character is not an ordinary ASCII minus, so
> it does not belong to base-char.  For sure you can check it with
> char-code.
> 
> If you need such chars (e.g. you do not generate them yourselves), use
> Lemmens suggestion about changing default character set.
> 
> Regards
> 
> ZJ
> 
> 
> Dnia 2017-01-14, sob o godzinie 07:56 -0800, BusFactor1 Inc. pisze:
>> I have the following code:
>> 
>> 
>> (setf dirname
>>    (concatenate 'string 
>>                           (coerce dirname 'text-string)
>>                           (coerce dp ‘text-string) "/"))
>> 
>> 
>> I get the following error with a certain directory input name:
>> 
>> 
>>    Error: #\– (of type CHARACTER) is not of type BASE-CHAR.
>> 
>> 
>> The filename is:  BLADE X3 WORKStation – SUSE Studio,1_files
>> 
>> 
>> The ‘dp’ is coming from the result of #’pathname-directory.
>> ‘dirname’ is simply the result of concatenating the dp parts together
>> with a “/“.
>> 
>> 
>> Any suggestions to help deal with this character range encoding
>> issue?  
>> 
>> 
>> —
>> Burton Samograd
>> 
>> 
>> —
>> Burton Samograd
>> BusFactor1@gmail.com http://BusFactor1.ca
>> http://twitter.com/BusFactor1 http://facebook.com/BusFactor1
>> http://instagram.com/BusFactor1
>> 
> 
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

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