Basic CF vs LF question

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

Basic CF vs LF question

Thelliez
Trying to import in GLASS the MailMessage code from Pharo, I encountered a String issue running a test method (selfTest).

Running the following code in Pharo (on MacOSX) returns 13.  The same code in GLASS (on Linux) returns 10.

selfTest2

    | s |

    s := 'a
b
'.
   
^ ( s at: 2 ) asInteger


That's fine, but MailMessage uses a 'String cr' at one point in the String parsing.  I thought there is a way to abstract the line break depending from the underlying platform but I cannot remember where it is. How do you deal with this issue?


Thierry
Reply | Threaded
Open this post in threaded view
|

Re: Basic CF vs LF question

Dale Henrichs
On 04/07/2011 10:04 AM, Thierry Thelliez wrote:

> Trying to import in GLASS the MailMessage code from Pharo, I encountered
> a String issue running a test method (selfTest).
>
> Running the following code in Pharo (on MacOSX) returns 13.  The same
> code in GLASS (on Linux) returns 10.
>
> selfTest2
>
>      | s |
>
>      s := 'a
> b
> '.
>
> ^ ( s at: 2 ) asInteger
>
>
> That's fine, but MailMessage uses a 'String cr' at one point in the
> String parsing.  I thought there is a way to abstract the line break
> depending from the underlying platform but I cannot remember where it
> is. How do you deal with this issue?
>
>
> Thierry

Thierry,

To make newline characters compatible with Squeak use
withSqueakLineEndings to convert a string with Squeak newlines to
GemStone newline conventions use withGemstoneLineEndings.

Dale