# unicode text &u.... sometimes works

**URL:** <https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474>\
**Category:** Getting Started\
**Created:** [May 5, 2017, 5:06pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474 "2017-05-05T17:06:32Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 5:06pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/1 "2017-05-05T17:06:32Z")

</div>

I have as the caption for a button &U25B6 or Black Right Pointing Triangle or “?” and it displays.  
If I add to a string, which is defined as UTF8, the character hex representation &U21BE or “?” an upwards harpoon with left pointing barb, I get just “&U21BE” and not the “?”.  
Why? I’ve read the LR section on literals, and the choice isn’t clear.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 5:07pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/2 "2017-05-05T17:07:28Z")

</div>

code showing how you’re adding it would be useful

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 5:16pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/3 "2017-05-05T17:16:41Z")

</div>

Clarification. I have for the Prime1R, which is a string property, currently “?” in the default. I tried the hex &U21BE and didn’t get the barb but &U21BE.

` KStr3 = Right(txt0, KRint)
    Kstr2 = Prime1L + KStr2 + Prime1R
    RCEdit(CtrlFocus).text = KStr1 + KStr2 + KStr3
    `  
Prime1R is the character above. Prime1L is the right one. They are global properties defined as encodings.UTF8 (I think that part is right)

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 5:42pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/4 "2017-05-05T17:42:56Z")

</div>

If its a string I suspect the VALUE is actually “&U21BE” and NOT the character value you expect  
But if this property is NOT actually something that will change at runtime use a constant

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 5:46pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/5 "2017-05-05T17:46:10Z")

</div>

yes. that’d work. How do I put this into default value? I’m pretty sure without something else I’d just get Not the character

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 5:56pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/6 "2017-05-05T17:56:47Z")

</div>

just put in  
&u21be  
it should work fine

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 5:57pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/7 "2017-05-05T17:57:50Z")

</div>

That is my confusion. It didn’t work on the property. I doubt constant is any better.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 6:30pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/8 "2017-05-05T18:30:00Z")

</div>

You really should try it before saying it wont work

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 6:31pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/9 "2017-05-05T18:31:58Z")

</div>

Before I begin, I did on the property and it didn’t work.  
It worked on caption, and I defined that later.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 6:33pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/10 "2017-05-05T18:33:51Z")

</div>

Just try it

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 7:48pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/12 "2017-05-05T19:48:27Z")

</div>

Sorry, but didn’t work either.  
A string before adding my Prime1 constants

> [@](#):
>
> Be round, circular, globular

string after adding my Prime1 constants

> [@](#):
>
> &U21BEBe round&U21BF, circular, globular

I thought it might be different since the Propertys don’t have “” quotes around the default values.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 8:46pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/13 "2017-05-05T20:46:54Z")

</div>

Had to go look at why this is and … yeah … it wont work either but probably should  
Sorry for the bum steer  
Has to do with us writing constants as specific types now  
Basically we used to write

```auto
    const Prime1 = &U21BE
```

but now write this as

```auto
    const Prime1 as string = "&U21BE"
```

This fixed a certain class of errors on compile (like when you wanted a TEXT not a STRING and there was no way to indicate this)

You CAN write a on line “const” like

```auto
    const Prime1 = &U21BE
```

at the top of the method where you want to use this though  
The compiler will figure out the right type

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 8:53pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/14 "2017-05-05T20:53:33Z")

</div>

Thank you.  
That is annoying. I also tried the datatype text for a new experience of a datatype. Same response. Good luck on the compiler fix.  
How do I declare by code a constant. My experience / understandiing is Nil. Where?  
My constants would be global. Could it still be global?  
The reason I’m asking is I learned recently to not declare them in the App but in a module.  
If so by code How?

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [May 5, 2017, 9:10pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/15 "2017-05-05T21:10:09Z")

</div>

You can also do chr(&h21BE)

If you want it global, create a computed property in a module as global, and place this in the getter, nothing in the setter. It will do the same as a constant.

```auto
Return chr(&h21BE)
```

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 9:15pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/16 "2017-05-05T21:15:39Z")

</div>

Do you know of an example in the “examples” of a computed property?

I just looked the term up on dev center and it didn’t show up easily.  
I’ve stayed away from this term for too long.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [May 5, 2017, 9:31pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/17 "2017-05-05T21:31:37Z")

</div>

1. Insert a module in the project
2. Right click the module, select add… / Computed property
3. Set the computed property as Global

The computed property contains two methods : get and set. Get returns the value of the computed property, set allows setting its value.

That’s about it.

The nice thing about computed properties is precisely they are a form of methods, so you can perform more complex tasks than with regular properties.

---

<div class="post-metadata">

**Author:** ![Arthur\_Gabhart](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/54ee81/32.png) [@Arthur\_Gabhart](https://forum.xojo.com/u/Arthur_Gabhart)\
**Post date:** [May 5, 2017, 9:50pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/18 "2017-05-05T21:50:17Z")

</div>

Thank you. Perfect.  
I see a lot of value there.

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [May 5, 2017, 10:27pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/19 "2017-05-05T22:27:41Z")

</div>

[quote=329348:@Arthur Gabhart]Thank you.  
That is annoying. I also tried the datatype text for a new experience of a datatype. Same response. Good luck on the compiler fix.  
[/quote]  
Not a compiler fix at all

[quote=329348:@Arthur Gabhart]How do I declare by code a constant. My experience / understandiing is Nil. Where?  
[/quote]  
in code put it before you use it (I like to put local constants like this at the very first few lines)

```auto
    const Prime1 = &U21BE
```

> [@329348:@Arthur Gabhart](#):
>
> My constants would be global. Could it still be global?

No  
Use a computed property if you need this to be global  
Its the same as adding a constant but instead you put code in the “Get” that returns the value you want

```auto
    return &U21BE
```

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:45pm UTC](https://forum.xojo.com/t/unicode-text-u-sometimes-works/37474/20 "2020-10-29T18:45:09Z")

</div>


