On Mar 31, 2008, at 5:38 AM, Arnaud Nicolet wrote:
> Le 30 mars 08 à 23:24 (soir), Joe Strout a écrit:
>
>> It's really quite simple: an app that writes text to a file has to
>> decide how to represent that text as bytes. An app that reads text
>> from a file has to decide how to interpret bytes as text. When those
>> decisions are not the same, then the text that's read isn't the same
>> as the text that was written. Nothing mysterious about that.
>
> I'm thinking of a feature request for RB but I don't know if it's
> technically possible:
>
> On each write of PStrings, RB automatically inserts the encoding of
> the string (e.g as an integer), in a way that does not disturb how
> PStrings work (e.g, after the PString).
> On read of a PString, RB automatically reads the PString and then the
> encoding, which it uses to convert the read PString.
>
> With this method, a beginner or someone who does not want to "care"
> about encodings (e.g a local app) doesn't have any problems.
> As far as I know, we can't do this programatically: we can't know the
> "name" or "value" of the encoding of <this particular> string and we
> can't either convert back something to an encoding. Can RS
> technically do that?
As has been pointed out, PStrings are very, very old and very, very
limited. I don't see why REAL would devote many resources to solving
this problem, especially since it would break all the existing code
that uses WritePString because the files would suddenly be
incompatible. Anyone using PStrings to write out encoded text should
bite the bullet and convert to some other method.
Eric Williams
Oxalyn Software
http://software.oxalyn.com/
AE Monitor
http://software.oxalyn.com/AEMonitor/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|