BUG: D4 String<<nextIndexOf:from:to: does not work with ASCII 176 character (degree symbol)...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG: D4 String<<nextIndexOf:from:to: does not work with ASCII 176 character (degree symbol)...

Christopher J. Demers
Code that works in Dolphin 3 does not work in Dolphin 4.  The degree symbol
ASCII 176 is not found in Strings when it should be.
I tracked the problem down to the primitive in String<<nextIndexOf:from:to:
See the example code bellow to duplicate the bug:

str := '5.0 °C'.
(str subStrings: $°) "Wrong"
str includes: $° "Wrong"
(str at: 5) = $° "Correct"

"FYI:"
$° asciiValue = 176

My workaround was to use (str subStrings: '°'), which works.  However the
initial bug should probably be addressed.  I am not sure if it also applies
to other high value ASCII characters.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: D4 String<<nextIndexOf:from:to: does not work with ASCII 176 character (degree symbol)...

Blair McGlashan
Christopher

Thanks for the report. This is caused by a signed/unsigned comparison error
in the VM primitive, and was easily fixed. The corrected VM will appear in
the 4.01 maintenance release which we are working on now. If you need this
fix urgently then I can e-mail you a new VM.

Regards

Blair

"Christopher J. Demers" <[hidden email]> wrote in
message news:96ctkr$kd50k$[hidden email]...
> Code that works in Dolphin 3 does not work in Dolphin 4.  The degree
symbol
> ASCII 176 is not found in Strings when it should be.
> I tracked the problem down to the primitive in
String<<nextIndexOf:from:to:

> See the example code bellow to duplicate the bug:
>
> str := '5.0 °C'.
> (str subStrings: $°) "Wrong"
> str includes: $° "Wrong"
> (str at: 5) = $° "Correct"
>
> "FYI:"
> $° asciiValue = 176
>
> My workaround was to use (str subStrings: '°'), which works.  However the
> initial bug should probably be addressed.  I am not sure if it also
applies
> to other high value ASCII characters.
>
> Chris
>
>