# Could we use Chinese or other 'utf-8' characters as the variable names?

**URL:** <https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400>\
**Category:** TypeDB\
**Created:** [22 September 2023 11:53 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400 "2023-09-22T11:53:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zack](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/zack/32/99_2.png) [@zack](https://forum.typedb.com/u/zack)\
**Post date:** [22 September 2023 11:53 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/1 "2023-09-22T11:53:57Z")

</div>

## Problem to Solve

Use Chinese characters as the variable names, since it’s more readable in application and more mantenable in development.

## Current Workaround

No good solusion yet. Like the Python supports any utf-8 as the variable names, I suggest that TypeDB should do this as well.

## Proposed Solution

No idea. Probably, learn from Python.

## Additional Information

I’m considering use LLM to query TypeDB, if TypeDB supports utf-8 variable names, then no translation between them.

---

<div class="post-metadata">

**Author:** ![zack](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/zack/32/99_2.png) [@zack](https://forum.typedb.com/u/zack)\
**Post date:** [2 October 2023 07:51 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/2 "2023-10-02T07:51:03Z")

</div>

It seems we can. But the read/write file of encoding of GUI seem not ‘utf-8’.

---

<div class="post-metadata">

**Author:** ![krishnan](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/krishnan/32/36_2.png) [@krishnan](https://forum.typedb.com/u/krishnan)\
**Post date:** [17 October 2023 11:10 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/3 "2023-10-17T11:10:20Z")

</div>

(Let’s move the discussion to this issue to avoid duplicate threads: [Could we use Chinese or other 'utf-8' characters as the variable names? · Issue #6899 · vaticle/typedb · GitHub](https://github.com/vaticle/typedb/issues/6899#issuecomment-1757334132))

---

<div class="post-metadata">

**Author:** ![RoseCliver](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@RoseCliver](https://forum.typedb.com/u/RoseCliver)\
**Post date:** [28 December 2023 17:39 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/4 "2023-12-28T17:39:29Z")

</div>

> [@zack](#):
>
> Use Chinese characters as the variable names, since it’s more readable in application and more mantenable in development.
> 
> ## Current Workaround
> 
> No good solusion yet. Like the Python supports any utf-8 as the variable names, I suggest that TypeDB should do this as well.
> 
> ## Proposed Solution
> 
> No idea. Probably, learn from Python.
> 
> ## Additional Information
> 
> I’m considering use LLM to query TypeDB, if TypeDB supports utf-8 variable names, then no translation between them.

Using Chinese characters for variable names in TypeDB could enhance readability. Emulating Python’s UTF-8 support might aid compatibility.

---

<div class="post-metadata">

**Author:** ![joshua](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/joshua/32/28_2.png) [@joshua](https://forum.typedb.com/u/joshua)\
**Post date:** [8 January 2024 12:59 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/5 "2024-01-08T12:59:50Z")

</div>

Hello,  
I just confirmed that TypeDB console, which shows that Chinese support is working in TypeDB labels and attribute values:

```auto
> transaction test-unicode data read
test-unicode::data::read> match $x isa entity; fetch $x: attribute;
                          
{
    "x": {
        "attribute": [{ "value": "test", "type": { "label": "name", "root": "attribute", "value_type": "string" } }],
        "type": { "label": "人", "root": "entity" }
    }
}
{
    "x": {
        "attribute": [{ "value": "黄", "type": { "label": "name", "root": "attribute", "value_type": "string" } }],
        "type": { "label": "人", "root": "entity" }
    }
}

```

However, I can also confirm that we don’t support variable names with utf-8:

```auto
test-unicode::data::read> match $人 isa entity; get;
                          
[TQL03] TypeQL Error: There is a syntax error at line 1:
match $人 isa entity; get;

```

We will look into relaxing this to allow unicode in variable names as well.

---

<div class="post-metadata">

**Author:** ![zack](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/zack/32/99_2.png) [@zack](https://forum.typedb.com/u/zack)\
**Post date:** [9 January 2024 12:54 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/6 "2024-01-09T12:54:22Z")

</div>

Yes, as you confirmed, the values support utf-8, but not the variables. Actually, if the variables can be utf-8, it will open a huge opportunity to use TypeDB as a knowledge engine for the east world, at least for Chinese/Asian people. If it’s not too hard to support the feature, please consider do it, I’m waiting for this for quite a long time. Hope I’m not alone, am I 😄

Best part of TypeDB quering is that it’s human readable. But without utf-8 of variable, it’s painful to construct the schema and query it when doing local language projects, since those important concepts are not obvious at first glance.

---

<div class="post-metadata">

**Author:** ![joshua](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/joshua/32/28_2.png) [@joshua](https://forum.typedb.com/u/joshua)\
**Post date:** [12 January 2024 15:25 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/7 "2024-01-12T15:25:47Z")

</div>

I think we’ll get UTF8 variables into the next release !

---

<div class="post-metadata">

**Author:** ![zack](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/zack/32/99_2.png) [@zack](https://forum.typedb.com/u/zack)\
**Post date:** [12 January 2024 16:36 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/8 "2024-01-12T16:36:30Z")

</div>

More than happy! Awesome~~

---

<div class="post-metadata">

**Author:** ![joshua](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/joshua/32/28_2.png) [@joshua](https://forum.typedb.com/u/joshua)\
**Post date:** [31 January 2024 18:34 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/9 "2024-01-31T18:34:31Z")

</div>

Try the 2.26.6-rc1 release that is out now 🙂

---

<div class="post-metadata">

**Author:** ![zack](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/zack/32/99_2.png) [@zack](https://forum.typedb.com/u/zack)\
**Post date:** [1 February 2024 08:49 UTC](https://forum.typedb.com/t/could-we-use-chinese-or-other-utf-8-characters-as-the-variable-names/400/10 "2024-02-01T08:49:13Z")

</div>

Wow, I definitely will, thanks for all your hard and great work!!
