# Problem: Cyrillic alphabet in array

**URL:** <https://forum.inductiveautomation.com/t/problem-cyrillic-alphabet-in-array/22242>\
**Category:** Ignition\
**Created:** [January 31, 2019, 9:30am UTC](https://forum.inductiveautomation.com/t/problem-cyrillic-alphabet-in-array/22242 "2019-01-31T09:30:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piotr.Olejnik](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Piotr.Olejnik](https://forum.inductiveautomation.com/u/Piotr.Olejnik)\
**Post date:** [January 31, 2019, 9:30am UTC](https://forum.inductiveautomation.com/t/problem-cyrillic-alphabet-in-array/22242/1 "2019-01-31T09:30:16Z")

</div>

Hello,  
I have some problem with Cyrillic alphabet in ignition scripting. When i get username from database that contains a Cyrillic character it’s ok as long as I keep it in single variable. But once i asign it into array, it changes it into some wired characters. For example code is:  
name1 = “Ничепоренко В.”  
name2 = “Домосканов Д.”  
array = [name1, str(name2)]  
print name1, name2  
print array

And the result:  
Ничепоренко В. Домосканов Д.  
[’\xd0\x9d\xd0\xb8\xd1\x87\xd0\xb5\xd0\xbf\xd0\xbe\xd1\x80\xd0\xb5\xd0\xbd\xd0\xba\xd0\xbe \xd0\x92.’, ‘\xd0\x94\xd0\xbe\xd0\xbc\xd0\xbe\xd1\x81\xd0\xba\xd0\xb0\xd0\xbd\xd0\xbe\xd0\xb2 \xd0\x94.’]

Is there any way to keep strings in array that are not converted to unicode?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 31, 2019, 1:39pm UTC](https://forum.inductiveautomation.com/t/problem-cyrillic-alphabet-in-array/22242/2 "2019-01-31T13:39:17Z")

</div>

This seems to be a quirk of the Jython list string representation. The values are what you would expect:

```auto
print array[0]
print array[1]

```

would yield

```auto
Ничепоренко В.
Домосканов Д.

```

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [January 31, 2019, 3:29pm UTC](https://forum.inductiveautomation.com/t/problem-cyrillic-alphabet-in-array/22242/3 "2019-01-31T15:29:22Z")

</div>

Note that you can print them all in one go, by using a join.

However, when trying in the console with Cyrillic, I just got a bunch of question marks. Most likely because the used font doesn’t have Cyrillic glyphs (and that’s probably why printing an array reverts to printing the utf representation). However, printing simple accents did work.

```auto
name1 = u"Tést"
name2 = u"Héló"
array = [name1, str(name2)]

print ",".join(array)

```

---

<div class="post-metadata">

**Author:** ![Piotr.Olejnik](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Piotr.Olejnik](https://forum.inductiveautomation.com/u/Piotr.Olejnik)\
**Post date:** [February 4, 2019, 10:43am UTC](https://forum.inductiveautomation.com/t/problem-cyrillic-alphabet-in-array/22242/4 "2019-02-04T10:43:56Z")

</div>

OK, so it does work with print but when using SQL database I have the same error. So the solution is to decode string:  
name1 = name1.decode(‘utf8’)  
And it helped 🙂

P.s. also the column in database have to be in proper encoding. For me it was cp1251\_general.
