Le 31 mars 08 à 16:19 (soir), Joe Strout a écrit:
> That's not possible, in the sense that such a function would no
> longer be WritePString/ReadPString. The point of those functions is
> to interface with files commonly used under Mac OS 9, where "PString"
> has a very specific definition (length byte followed by up to 255
> bytes of data in a WorldScript encoding). If you write anything
> else, then you're no longer adhering to the definition, thus
> rendering the function pretty pointless.
Why not WritePStringWithEncoding and ReadPStringWithEncoding that
writes/reads like a PString with, additionally, a byte for the encoding?
>> 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.
>
> Sure you can: string.Encoding gives you exactly that.
>
Yes it does, but what do you do with the result to save it and
retrieve it?
I mean: you have Base, Code, Format, InternetName and Variant
properties for the TextEncoding class, but you can't just save these
values (the most significant ones) in a file and then make a new
TextEncoding object with the values you read back, can you?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|