# Unicode characters in python annotation

**URL:** https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385
**Category:** ParaView Support
**Tags:** python
**Created:** [June 25, 2023, 8:34am UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385 "2023-06-25T08:34:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Rojj](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rojj/32/1409_2.png) [@Rojj](https://discourse.paraview.org/u/Rojj)
#### Post date: [June 25, 2023, 8:34am UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385/1 "2023-06-25T08:34:22Z")

</div>

I am trying to use a unicode character in a python annotation, but it is being ignored. Am I doing something wrong or it is not possible?

I can see the character in the editor, but it does not show in the view. This is an extract of the python annotation (it is generated by a python script)

`["dbT: 23.9°C\nRH: 61.0%\nws: 2.5m/s\nwd: 263.0°(←)",.....][t_index]`

As you can see, the arrow symbol ← is there, but it does not show in the view

![image](https://discourse.paraview.org/uploads/default/original/2X/f/f06c8a1cc5a522b428b603bfbf13692bdd14a946.png)

Any suggestion?

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 25, 2023, 1:47pm UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385/2 "2023-06-25T13:47:56Z")

</div>

It should work but the string must contain utf8 characters. Have you checked the encoding?

---

<div class="post-metadata">

### Author: ![Rojj](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rojj/32/1409_2.png) [@Rojj](https://discourse.paraview.org/u/Rojj)
#### Post date: [June 25, 2023, 2:40pm UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385/3 "2023-06-25T14:40:56Z")

</div>

> [@todoooo](#):
>
> utf8

I think so. The string is generated by a python script in this way

```auto
python_string = (",").join([f"\"dbT: {dbT}°C\\nRH: {rh}%\\nws: {ws}m/s\\nwd: {wd}°({angle_to_arrow(wd)})\"" for dbT, rh, ws, wd in zip(dbTs, rhs, wss, wds)])
pythonAnnotation2.Expression = f"[{python_string}][t_index]"

```

And I can actually see the symbol in the expression editor

 ![image](https://discourse.paraview.org/uploads/default/original/2X/2/2a9ad79502ddb3240e2d34dae87ce52b513595d1.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [June 25, 2023, 2:48pm UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385/4 "2023-06-25T14:48:48Z")

</div>

I don’t think the embedded fonts in VTK have all of the fancy symbols.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 28, 2023, 7:45am UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385/5 "2023-06-28T07:45:38Z")

</div>

Use latex mode

`"$←$"`

 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f3a12374428c043e926e3427c658068b5debe511.png)

---

<div class="post-metadata">

### Author: ![Rojj](https://discourse.paraview.org/user_avatar/discourse.paraview.org/rojj/32/1409_2.png) [@Rojj](https://discourse.paraview.org/u/Rojj)
#### Post date: [June 28, 2023, 8:27am UTC](https://discourse.paraview.org/t/unicode-characters-in-python-annotation/12385/6 "2023-06-28T08:27:40Z")

</div>

Perfect! Thanks @mwestphal

![image](https://discourse.paraview.org/uploads/default/original/2X/3/32808388719c401a4af36f9cf43fb110d4f9128a.png)
