TextInputStream Example with encoding

Hi,

It is also about TextInputStream:

In the example, I can see a line to set the encoding *:

textInput.Encoding = Encodings.MacRoman //strings are MacRoman

But the documentation reveal:

TextInputStream.ReadLine ( [Encoding as TextEncoding] ) As String

Worse: TextInputStream.ReadLine example do not even use that syntax…

At last, the example is far more complex than needed (and to my surprise works perfectly fine).

What’s your feeling:
A I right and the documentation have to be modified
Or I am too fastidious (pointilleux in French) ?

  • In 2013, who still use MacRoman ?
    The answer is not: “Someone who have MacRoman Strings”.
    Why ?
    Because he will have MacRoman string after no one will remember that encoding.
    Time to pass to UTF is long done. I’ve doing that road once Encodings comes to Xojo and I understand its use.

The documentation could be clearer. Xojo has done a lot to improve their documentation and there is still more to be done.

[quote=54300:@Emile Schwarz]But the documentation reveal:

TextInputStream.ReadLine ( [Encoding as TextEncoding] ) As String

Worse: TextInputStream.ReadLine example do not even use that syntax…
[/quote]
Are you trying this with the square brackets? The use of square brackets in this case indicates that the use of an encoding is optional. My test works as expected:

theEncodedString = theTextInputStream.ReadLine(Encodings.MacRoman)

Language misunderstanding. Take a look at the example. Your test works as is mine.
Sorry for the unclear statement(s).