Handling of special characters like °

classic Classic list List threaded Threaded
6 messages Options
JLan JLan
Reply | Threaded
Open this post in threaded view
|

Handling of special characters like °

Is there a good explanation for this behavior? It is of course possible to work around it, but the extra character has caused me some unwanted shifts in strings.

--> d=ascii('°')
 d  =
   194.   176.
--> ascii(d(1))
 ans  =
 Â
--> ascii(d(2))
 ans  =
 °
--> ascii(d)
 ans  =
 °
--> ascii(d(1))+ascii(d(2))
 ans  =
 Â°
--> ascii([194 176])
 ans  =
 °
--> ascii([194 194])
 ans  =
 ÂÂ
-->ascii(ascii(176))
 ans  =
   194.   176.

Brgds Jan
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Handling of special characters like °

Hello,

> De : users [mailto:[hidden email]] De la part de JLan
> Envoyé : samedi 27 mai 2017 10:21
>
> Is there a good explanation for this behavior? [...]
>
> --> d=ascii('°')
>  d  =
>  194.   176.

I've got the same behaviour here and I think this deserves a bug report.

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
JLan JLan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Handling of special characters like °



On 29.05.2017 10:15, Dang Ngoc Chan, Christophe wrote:

> Hello,
>
>> De : users [mailto:[hidden email]] De la part de JLan
>> Envoyé : samedi 27 mai 2017 10:21
>>
>> Is there a good explanation for this behavior? [...]
>>
>> --> d=ascii('°')
>>   d  =
>>   194.   176.
> I've got the same behaviour here and I think this deserves a bug report.
>
> Regards
>
> --
> Christophe Dang Ngoc Chan
>
Done

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Tan Chin Luh-2 Tan Chin Luh-2
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Handling of special characters like °

In reply to this post by Christophe Dang Ngoc Chan
I think this is the utf-8 encoding, which 194 is the starting byte for 2
bytes sequence to represent a character.

rgd,
CL

On 29/5/2017 4:15 PM, Dang Ngoc Chan, Christophe wrote:

> Hello,
>
>> De : users [mailto:[hidden email]] De la part de JLan
>> Envoyé : samedi 27 mai 2017 10:21
>>
>> Is there a good explanation for this behavior? [...]
>>
>> --> d=ascii('°')
>>   d  =
>>   194.   176.
> I've got the same behaviour here and I think this deserves a bug report.
>
> Regards
>
> --
> Christophe Dang Ngoc Chan
> Mechanical calculation engineer
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Alain LAMY Alain LAMY
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Handling of special characters like °

In reply to this post by Christophe Dang Ngoc Chan
Hi,

I stumbled upon the same oddity recently.
I also think that some improvement is necessary.


Suggestions (for discussion):

ascii(string) => array of size 1xN (N = length(string)), or "ERROR" if the string contains extended characters.
 
ascii(string, option="ext") => array of size pxN, with p = 3 or whatever value is needed.
       
(or it could be the opposite convention : returned size = p x N by default ...)

Alain


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
JLan JLan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Handling of special characters like °

Thank you all for for comments

You may want to comment in the bug report:
http://bugzilla.scilab.org/show_bug.cgi?id=15172

Jan

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users