Format() and Str() return strings in ASCII encoding, not UTF8

Which documentation does it contradict? Perhaps that can be updated.

I agree with Kem. And to say that this contradicts a parenthetical remark in an unrelated piece of documentation is a bit of a stretch, imho. At the end of the day, it really doesn’t make any difference at all. Sure, they could clutter up the documentation page of Str() with a statement that it returns a ASCII encoded string, but wouldn’t that give the mistaken impression that it somehow matters?

Xojo states that it uses UTF-8 encoding by default. It doesn’t always. And THAT is inconsistent, led to the confusion here, and could be easily fixed by ACTUALLY using UTF-8 as default encoding.

Saying the solution would be to “unnecessarily clutter up the documentation” shows that you haven’t understood the point we were trying to make, which is that the current situation causes unnecessary confusion (and will again in the future) when it is so easily preventable.

And no, “unnecessarily cluttering up the documentation” is not what I would call a solution.

But, US-ASCII is UTF-8.

No, that is where you are wrong.

US-ASCII is a SUBSET of UTF-8, and while they have the same content for the first 128 code points and are therefore compatible, they are NOT the same.

That also doesn’t address the confusion, especially to beginners coming to encodings for the first time. It is simply inconsistent and a source of VERY unnecessary confusion.

It’s like talking to a wall.

You’re right. I think that they should return ISO-8859-1.

The documentation was updated this morning. Problem solved.

Nope. Still states that strings default to UTF-8. Still inconsistent.

And I wouldn’t call it a solution. That’s like calling a pothole in the road repaired by putting up a sign warning of potholes … so if they say “strings default to UTF-8” then maybe they should just do that …

Cluttering up? Tsk tsk, Tim. I came to Xojo after years of using PHP, whose documentation is always “cluttered up” with information about exceptions to the rule, things to beware of, and examples. And with the ability for users to add notes. Xojo has some way to go in this department.

From the docs on String:

[emphasis mine]

Where did you mean?

This is not one of those. It literally makes no difference to anything. It is an oddity, to be sure, but it’s not going to bite you at any time. I think it would be nice if Xojo would change the encoding to UTF8, but I don’t want them using my license dollars to do it. I’d prefer they focus on important things that we should beware of.