contentsOfEntireFile

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

contentsOfEntireFile

Zulq Alam
Hi,

I've observed some strange behavior when using #contentsOfEntireFile on
FileStream for a file containing the character ’ (0x92).

For example, the following code will print the contents of the attached
example file until it reaches this character.

| example |
example := FileStream fileNamed: 'example.txt'.
Transcript show: example contentsOfEntireFile.
example close.

By the way, I've no desire to use this character - it just happened to
be in my test data.

Am I doing something wrong or is this an issue. If it is, how do I raise
it properly?

I'm running 3.8-6665 on Windows XP.

Thanks,
Zulq.

This text will be shown. ’ This text will not be shown.


Reply | Threaded
Open this post in threaded view
|

Re: contentsOfEntireFile

Andreas.Raab
This is most likely related to http://bugs.impara.de/view.php?id=3440.

Cheers,
   - Andreas

Zulq Alam wrote:

> Hi,
>
> I've observed some strange behavior when using #contentsOfEntireFile on
> FileStream for a file containing the character ’ (0x92).
>
> For example, the following code will print the contents of the attached
> example file until it reaches this character.
>
> | example |
> example := FileStream fileNamed: 'example.txt'.
> Transcript show: example contentsOfEntireFile.
> example close.
>
> By the way, I've no desire to use this character - it just happened to
> be in my test data.
>
> Am I doing something wrong or is this an issue. If it is, how do I raise
> it properly?
>
> I'm running 3.8-6665 on Windows XP.
>
> Thanks,
> Zulq.
>
>
> ------------------------------------------------------------------------
>
> This text will be shown. ’ This text will not be shown.
>
>
> ------------------------------------------------------------------------
>
>


Reply | Threaded
Open this post in threaded view
|

Re: contentsOfEntireFile

Zulq Alam
You are right. I filed in UTF8InputFix.2.cs and I now get a Invalid utf8
input detected error.

How can I guard against this? I can't guarentee this character wont end
up in input data.

Z.

Andreas Raab wrote:

> This is most likely related to http://bugs.impara.de/view.php?id=3440.
>
> Cheers,
>   - Andreas
>
> Zulq Alam wrote:
>> | example |
>> example := FileStream fileNamed: 'example.txt'.
>> Transcript show: example contentsOfEntireFile.
>> example close.


Reply | Threaded
Open this post in threaded view
|

Re: contentsOfEntireFile

Andreas.Raab
Well, what are trying to read? Bytes? Use binary mode. Text? Depends on
the encoding. If it's Latin1 use Latin1TextConverter, for Mac Roman use
MacRomanTextConverter, for shift-jis use ShiftJISTextConverter, for UTF8
use UTF8TextConverter etc. See subclasses of TextConverter.

Cheers,
   - Andreas

Zulq Alam wrote:

> You are right. I filed in UTF8InputFix.2.cs and I now get a Invalid utf8
> input detected error.
>
> How can I guard against this? I can't guarentee this character wont end
> up in input data.
>
> Z.
>
> Andreas Raab wrote:
>> This is most likely related to http://bugs.impara.de/view.php?id=3440.
>>
>> Cheers,
>>   - Andreas
>>
>> Zulq Alam wrote:
>>> | example |
>>> example := FileStream fileNamed: 'example.txt'.
>>> Transcript show: example contentsOfEntireFile.
>>> example close.
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: contentsOfEntireFile

stéphane ducasse-2
Will be in 39a-7022

If you have other pending fixes that we missed please do not forget  
to ping us....(life is erratic here).

>>> 3440

Stef


Reply | Threaded
Open this post in threaded view
|

Re: contentsOfEntireFile

Zulq Alam
In reply to this post by Andreas.Raab
Text, but I don't know what encodings but that's more to do with not
knowing the final shape of the application yet. Thanks for your help.

Z.

Andreas Raab wrote:

> Well, what are trying to read? Bytes? Use binary mode. Text? Depends
> on the encoding. If it's Latin1 use Latin1TextConverter, for Mac Roman
> use MacRomanTextConverter, for shift-jis use ShiftJISTextConverter,
> for UTF8 use UTF8TextConverter etc. See subclasses of TextConverter.
>
> Cheers,
>   - Andreas
>
> Zulq Alam wrote:
>> You are right. I filed in UTF8InputFix.2.cs and I now get a Invalid
>> utf8 input detected error.
>>
>> How can I guard against this? I can't guarentee this character wont
>> end up in input data.
>>
>> Z.
>>
>> Andreas Raab wrote:
>>> This is most likely related to http://bugs.impara.de/view.php?id=3440.
>>>
>>> Cheers,
>>>   - Andreas
>>>
>>> Zulq Alam wrote:
>>>> | example |
>>>> example := FileStream fileNamed: 'example.txt'.
>>>> Transcript show: example contentsOfEntireFile.
>>>> example close.
>>
>>
>>
>
>
>
>
>
>