TextEncoding.Code?

The docs (http://documentation.xojo.com/api/text/encoding_text/textencoding.html#textencoding-code) say:

[quote]The Mac OS TextEncoding value, useful for declares.

Notes
You can also use it to compare two encodings: If the Code properties of two TextEncoding objects are equal, then they represent the same text encoding (including base, variation, and format).[/quote]

Is this Mac only or can this be used X-Platform? If not Mac only maybe, the docs should mention that? Right now the docs imply Mac only.

But the the docs for Encodings.GetFromCode does not say anything about being Mac specific so I suspect it is X-Platform at least if we are talking about Xojo Apps. I am writing code that depends on that…Am I making a mistake?

  • karen

I think the code is how macOS encodes it, not Windows.

In that case the docs for Encodings.GetFromCode should ether say Nac only or Not X-Platform if it is platform specific(And If Platform specific then the Docs for TextEndoding.code should say that…

In an Xplatform product like Xojo, the docs need to be very specific about platform specificity whenever it rears it’s ugly head!

  • karen

FWIW I’m trying to write a X-Platform net data transfer class and I want to be able to accept incoming text in any specified text encoding Xojo can dealt, without having to iterate through all possible encodings to find a match.

I thought Encodings.GetFrom code would be that… but if it’s platform specific , the only way would be to iterate though all of them checking TextEncoding.InternetName…

Seems an overly complex and unintuitive way to me!

-karen