# UTF-8 Character output

**URL:** <https://ifnotnil.com/t/utf-8-character-output/3319>\
**Category:** Other\
**Created:** [12 June 2023 16:20 UTC](https://ifnotnil.com/t/utf-8-character-output/3319 "2023-06-12T16:20:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [12 June 2023 16:20 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/1 "2023-06-12T16:20:54Z")

</div>

> **[Different UTF-8 character output with chr()](https://forum.xojo.com/t/different-utf-8-character-output-with-chr/76143)**
>
> I set a Textfield text whith this Code: TextField1.Text = "¶" + " " + chr(&hc2b6) The Output of the Textfield is: Why is the Char, set with CHR different? The UTF-8 coding table say: How can i add a Unicode Character with hexcode?

SOMEONE please post this to TOF

He’s done at least 2 things wrong

1. used CHR but …
2. is trying to put the BYTES in not the Unicode code point

```auto
me.Text = "¶" + " " + &uB6

```

OR

```auto
Me.Text = "¶" + " " + Encodings.UTF8.Chr(&hB6)

```

---

<div class="post-metadata">

**Author:** ![Tim](https://ifnotnil.com/user_avatar/ifnotnil.com/tim/32/13_2.png) [@Tim](https://ifnotnil.com/u/Tim)\
**Post date:** [12 June 2023 16:30 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/2 "2023-06-12T16:30:19Z")

</div>

This is what they consider their official support channel. Their users get the support they get because of the choices Xojo has made.

---

<div class="post-metadata">

**Author:** ![Torsten\_B](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@Torsten\_B](https://ifnotnil.com/u/Torsten_B)\
**Post date:** [12 June 2023 17:33 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/3 "2023-06-12T17:33:04Z")

</div>

Xojo’s Unicode support is a mess.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [12 June 2023 17:48 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/4 "2023-06-12T17:48:52Z")

</div>

Certainly things like FORMAT and other built in functions have issues with non-English locales

Those I’d consider bugs

What other things have you run into ?

---

<div class="post-metadata">

**Author:** ![Jeannot](https://ifnotnil.com/user_avatar/ifnotnil.com/jeannot/32/3787_2.png) [@Jeannot](https://ifnotnil.com/u/Jeannot)\
**Post date:** [12 June 2023 19:08 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/5 "2023-06-12T19:08:44Z")

</div>

isn’t UTF-8’s purpose to solve challenges with so many global locales? 😉

Granted, people who never had to work with non-US locales don’t care (any yes, I know that you are working with international customers too, I’m pointing to the green master of disaster). So, as always, if you are targeted audience for those bugs, you don’t really care if it might work for some 😉

But it is probably easier to get rid of international special characters than hoping that the Greens will care.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [12 June 2023 19:18 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/6 "2023-06-12T19:18:16Z")

</div>

UTF-8 does in many ways

But there are functions people try to use IN Xojo & its frameworks that do things wrong  
As if they are coded to only assume USA or English conventions  
Dates, times, currency and other locale specific things seem to be many of the culprits  
And that is separate & apart from UTF-8

I’m sure if someone cared tot hey could find recent discussion of this on TOF but … myeh

[https://tracker.xojo.com/xojoinc/xojo/-/issues/72471](https://tracker.xojo.com/xojoinc/xojo/-/issues/72471)  
[https://tracker.xojo.com/xojoinc/xojo/-/issues/66499](https://tracker.xojo.com/xojoinc/xojo/-/issues/66499)

---

<div class="post-metadata">

**Author:** ![Jeannot](https://ifnotnil.com/user_avatar/ifnotnil.com/jeannot/32/3787_2.png) [@Jeannot](https://ifnotnil.com/u/Jeannot)\
**Post date:** [12 June 2023 19:30 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/7 "2023-06-12T19:30:39Z")

</div>

yes, you are speaking to someone who has suffered greatly from this ignorance.

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [12 June 2023 21:04 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/8 "2023-06-12T21:04:51Z")

</div>

There are some problems even more hurting. Math. Currencies. And many more. So I guess Coding is not the biggest one. Setting all to UTF8 is like an insurance not to get stresses. Many people don’t get how important that is and run into issues which are not even related to Xojo by self but to the used encoding.

---

<div class="post-metadata">

**Author:** ![Torsten\_B](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@Torsten\_B](https://ifnotnil.com/u/Torsten_B)\
**Post date:** [13 June 2023 02:43 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/9 "2023-06-13T02:43:03Z")

</div>

Can’t find the thread in TOF anymore. It had to do with string.length which delivered different results for ‘u’ and ‘ü’. I do remember that the sample code for the workaround in doc was faulty. It was a ‘we are transitioning from API1 to API2’ issue.

---

<div class="post-metadata">

**Author:** ![bgrommes](https://ifnotnil.com/user_avatar/ifnotnil.com/bgrommes/32/2651_2.png) [@bgrommes](https://ifnotnil.com/u/bgrommes)\
**Post date:** [13 June 2023 12:17 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/10 "2023-06-13T12:17:07Z")

</div>

> [@Torsten\_B](#):
>
> Can’t find the thread in TOF anymore. It had to do with string.length which delivered different results for ‘u’ and ‘ü’.

.NET returns 1 for “ü”.Length (as it should). It is 1 _character_ long. That it involves 2, 3 or 4 bytes for that particular character is an implementation detail depending on what encoding you’re using.

There is a separate method to get the byte count, as there should be (Encoding.GetByteCount()).

If Xojo is returning some value other than 1 for the length of any one character string regardless of encoding, then that is a bug, a confused API design, or both. Which is certainly reminiscent of other hacks they are known to do, such as parsing the OS version string instead of calling OS APIs, with resulting abstraction leakage for users not on their “happy path”.

---

<div class="post-metadata">

**Author:** ![Alberto](https://ifnotnil.com/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@Alberto](https://ifnotnil.com/u/Alberto)\
**Post date:** [13 June 2023 13:27 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/11 "2023-06-13T13:27:45Z")

</div>

I don’t have experience with .NET but I understand there are 2 ways to show ü:

- U+00FC
- u + (U+0308)

Xojo has problems with the second one, reporting it as Length 2 with 3 bytes.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [13 June 2023 14:12 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/12 "2023-06-13T14:12:23Z")

</div>

ah yes - text fixed this since it didnt count “bytes”, or code points, but “characters”

[https://docs.xojo.com/Text](https://docs.xojo.com/Text)

> All of the APIs on the Text type operate in characters. For example, if the APIs worked in terms of Unicode code points, it would be possible to corrupt data using Left/Mid/Right if the positions happened to be in the middle of a composed character or grapheme cluster. Working in characters also avoids situations where the length of ‘é’ can be either 1 or 2.

Text got this right  
But … 🤷‍♂️

 ![Screen Shot 2023-06-13 at 8.11.50 AM](https://ifnotnil.com/uploads/default/original/2X/b/be5a27c7be0ca163265fff91323ae7fffd85b7ac.png)

---

<div class="post-metadata">

**Author:** ![Torsten\_B](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@Torsten\_B](https://ifnotnil.com/u/Torsten_B)\
**Post date:** [13 June 2023 14:59 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/13 "2023-06-13T14:59:07Z")

</div>

> [@npalardy](#):
>
> text fixed this

In an act of unfathomable wisdom, Xojo decided that Text is deprecated, leaving people who need to deal with text and not with stringy bytes alone. This was the first moment when I thought that Xojo won’t become my tool…

The inability to deal with Text alone excludes Xojo from the low code tools list.

---

<div class="post-metadata">

**Author:** ![bgrommes](https://ifnotnil.com/user_avatar/ifnotnil.com/bgrommes/32/2651_2.png) [@bgrommes](https://ifnotnil.com/u/bgrommes)\
**Post date:** [13 June 2023 15:04 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/14 "2023-06-13T15:04:41Z")

</div>

> [@Torsten\_B](#):
>
> In an act of unfathomable wisdom, Xojo decided that Text is deprecated

“His ways are not our ways; his ways are past finding out …”

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [13 June 2023 15:14 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/15 "2023-06-13T15:14:32Z")

</div>

Be nice if they just kept both

BUT, in this case, they listened to customers who bitched long & loud about how hard it was to use text, how slow it was for using as a generic bucket of bytes ( 🤦‍♂️) and other _complaints_  
So they deprecated text 🤦‍♂️

I’d prefer they keep both since TEXT has characteristics that make it perfect for dealing with TEXT

but … 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![Jeannot](https://ifnotnil.com/user_avatar/ifnotnil.com/jeannot/32/3787_2.png) [@Jeannot](https://ifnotnil.com/u/Jeannot)\
**Post date:** [13 June 2023 15:17 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/16 "2023-06-13T15:17:58Z")

</div>

I will never understand people complaining about something new because they don’t like it, just don’t use it. But that’s the issue with Xojo and deprecating old stuff. You have to complain about new approaches, as otherwise the old ones will be sunset ☹

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [13 June 2023 15:21 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/17 "2023-06-13T15:21:33Z")

</div>

> [@Jeannot](#):
>
> they don’t like it, just don’t use it.

Yes but - ITS NEW IT MUST BE BETTER !!! right ???  
Text was “better” for the things it was designed for - representing TEXT  
Was it better for manipulating long ranges of bytes ?  
NO … but why not ?  
It was designed for representing TEXT - not BYTES !

but … 🤦‍♂️

This was part of the Xojo framework - which was 100% OPTIONAL (except for iOS)  
No one shoved it down anyones throat  
But OMG Its new we should adopt every last piece of it yesterday !

🤦‍♂️

---

<div class="post-metadata">

**Author:** ![Jeannot](https://ifnotnil.com/user_avatar/ifnotnil.com/jeannot/32/3787_2.png) [@Jeannot](https://ifnotnil.com/u/Jeannot)\
**Post date:** [13 June 2023 15:24 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/18 "2023-06-13T15:24:15Z")

</div>

I remember those discussions, and never understood them. The idea of frameworks was as wise move and finally something promising and a modern approach of doing things. I believe it would have avoided tons of current challenges, but ok … I am just silly and others know better.

That’s the funny thing. The average Xojo user is happy, that it is not called BASIC any longer, but many seem to adhere to BASIC concepts.

---

<div class="post-metadata">

**Author:** ![bkeeney](https://ifnotnil.com/user_avatar/ifnotnil.com/bkeeney/32/225_2.png) [@bkeeney](https://ifnotnil.com/u/bkeeney)\
**Post date:** [13 June 2023 15:29 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/19 "2023-06-13T15:29:32Z")

</div>

I wish they had kept Text as well. Speed issues they could have fixed over time I believe. However, Strings still have the same flaws it always did. So nothing fixed, nothing to see. Move on.

---

<div class="post-metadata">

**Author:** ![Torsten\_B](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@Torsten\_B](https://ifnotnil.com/u/Torsten_B)\
**Post date:** [13 June 2023 17:35 UTC](https://ifnotnil.com/t/utf-8-character-output/3319/20 "2023-06-13T17:35:19Z")

</div>

Don’t miss the opportunity to hear His words and wisdom: 😊 😊 😊

 ![Screenshot 2023-06-13 at 19.33.48](https://ifnotnil.com/uploads/default/original/2X/8/8d39eebc0430de076b0ddea49c31a745a865560d.png)

…along with a chance to get answers to your Xojo questions…huuuuuuuuuh

[Next page](https://ifnotnil.com/t/utf-8-character-output/3319.md?page=2)
