# How to use the utf8 Japanese characters in ROOT Session?

**URL:** <https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241>\
**Category:** ROOT\
**Created:** [September 24, 2014, 10:28pm UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241 "2014-09-24T22:28:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![buynnnmmm1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@buynnnmmm1](https://root-forum.cern.ch/u/buynnnmmm1)\
**Post date:** [September 24, 2014, 10:28pm UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/1 "2014-09-24T22:28:50Z")

</div>

Dear ROOT Support,

Could you tell me how to use the utf8 Japanese character in “ROOT Session”?

I can use utf8 Japanese charactors in files, and I can execute these codes with .x command in ROOT Session.  
But I would like to try while changing various instructions in the interactive environment .

I type root at the system promp, and I type Japanese utf8 charactors in ROOT session, these charactors will not be displayed on the terminal.  
How can I do it?

With best regards  
buynnnmmm1

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 25, 2014, 7:53am UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/2 "2014-09-25T07:53:19Z")

</div>

I told you how to display Japanese character on the canvas using TMathText in an other post …  
Now I am not sure what you are doing ? Are you trying to run a macro with Japanese characters ?  
I guess they are comments ?  
Can you post the macro here ?

---

<div class="post-metadata">

**Author:** ![buynnnmmm1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@buynnnmmm1](https://root-forum.cern.ch/u/buynnnmmm1)\
**Post date:** [September 26, 2014, 12:09am UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/3 "2014-09-26T00:09:05Z")

</div>

[quote=“couet”]I told you how to display Japanese character on the canvas using TMathText in an other post …  
Now I am not sure what you are doing ? Are you trying to run a macro with Japanese characters ?  
I guess they are comments ?  
Can you post the macro here ?[/quote]

Dear ROOT Support,

Thank you for reply immediately.  
I can use UTF Japanese characters in files, I can use these macros with .x , .E or .L commands in ROOT Session.  
However , I can not enter the Japanese characters with the copy and paste even if the key type.

first, I type “root” , and push [Enter] key.

```auto
$ root

```

Then start a ROOT Session.

```auto
  * *
  * W E L C O M E to R O O T *
  * *
  * Version 5.34/19 9 July 2014 *
  * *
  * You are welcome to visit our Web site *
  * http://root.cern.ch *
  * *
  *******************************************

ROOT 5.34/19 (heads/v5-34-00-patches@v5-34-18-592-g34af149, Jul 19 2014, 12:18:00 on linux)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] 

```

I exec cat command and view source of TMathTextJapanese\_01.C file.

```auto
root [0] .! cat TMathTextJapanese_01.C
{
  TMathText *js=new TMathText(0.2,0.8,"a標準偏差c");
  js->Draw();
}

```

I can display Japanese charactors with this command. ( blue part in a screenshot attached image )

I execute TMathTextJapanese\_01.C with .x comand.

```auto
root [1] .x TMathTextJapanese_01.C
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1

```

I can execute files with UTF Japanese charactors with .x, .L and .E commands.

I can display UTF Japanese charactors with TMath::GetTitle() Method. ( blue part in a screenshot attached image )

```auto
root [2] js->GetTitle()
(const char* 0xa2b47d0)"a標準偏差c"

```

I copy and paste the line I have selected.

```auto
root [3] TMathText *js=new TMathText(0.2,0.8,"ac");

```

It is not possible to enter the UTF Japanese characters in the copy and paste.  
(red part in a screenshot attached image)

I check the new title string with TMath::GetTitle() Method.

```auto
root [4] js->GetTitle()
(const char* 0xa248e69)"ac"

```

It is not include Japanese chractors.  
(red part in a screenshot attached image)

It is not possible to enter the Japanese characters not just copy and paste , I can either type normally .

How can I enter Japanese characters in ROOT Sessions?

With best regards  
buynnnmmm1

(a screenshot attached)

 ![](https://root-forum.cern.ch/uploads/default/original/2X/8/8949a5cebf27f881186eeb0dc66cb214ef373305.png)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 26, 2014, 7:23am UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/4 "2014-09-26T07:23:05Z")

</div>

May be that’s a more general problem with the terminal window. Can you copy/paste a Japanese character after the Unix command line prompt (outside ROOT) ?

---

<div class="post-metadata">

**Author:** ![buynnnmmm1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@buynnnmmm1](https://root-forum.cern.ch/u/buynnnmmm1)\
**Post date:** [September 26, 2014, 8:08am UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/5 "2014-09-26T08:08:06Z")

</div>

> [@couet](#):
>
> May be that’s a more general problem with the terminal window. Can you copy/paste a Japanese character after the Unix command line prompt (outside ROOT) ?

Dear ROOT Support,

Thank you very much for reply immediately.

> Can you copy/paste a Japanese character after the Unix command line prompt (outside ROOT) ?

Yes, I can do it.  
I can copy/paste Japanese characters after the Unix command line prompt (outside ROOT).

With best regards  
buynnnmmm1

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 26, 2014, 8:19am UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/6 "2014-09-26T08:19:31Z")

</div>

Hi,

This is very likely a limitation of our text input library. I suspect support would need changes in two files, core/textinput/src/textinput/KeyBinding.cpp and maybe even core/textinput/src/textinput/Editor.cpp.

I don’t think we will be implementing this ourselves, but we would definitely welcome patches that add support for it.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![buynnnmmm1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@buynnnmmm1](https://root-forum.cern.ch/u/buynnnmmm1)\
**Post date:** [September 26, 2014, 10:02am UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/7 "2014-09-26T10:02:13Z")

</div>

[quote=“Axel”]Hi,

This is very likely a limitation of our text input library. I suspect support would need changes in two files, core/textinput/src/textinput/KeyBinding.cpp and maybe even core/textinput/src/textinput/Editor.cpp.

I don’t think we will be implementing this ourselves, but we would definitely welcome patches that add support for it.

Cheers, Axel.[/quote]

Dear, Axel and ROOT Suppot,

Thank you very much for reply immediately.  
Thank you very much for teaching me Files that are related to enter utf8 characters.  
I will try to make a patche can enter utf8 characters.  
I will send if I make it .

Thank you very much for your help!

With best regards  
buynnnmmm1

---

<div class="post-metadata">

**Author:** ![iboyildizbk](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/2bfe46/32.png) [@iboyildizbk](https://root-forum.cern.ch/u/iboyildizbk)\
**Post date:** [July 2, 2018, 1:54pm UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/8 "2018-07-02T13:54:44Z")

</div>

Is there any solution to this issue?(utf8 problem in cling interpreters terminal) thanks…

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 2, 2018, 3:04pm UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/9 "2018-07-02T15:04:06Z")

</div>

Hi,

Please don’t resurrect 4 year old posts but start a new one.

We have UTF8 support in cling since some years now.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 2, 2018, 3:04pm UTC](https://root-forum.cern.ch/t/how-to-use-the-utf8-japanese-characters-in-root-session/18241/10 "2018-07-02T15:04:13Z")

</div>

Closed on July 2, 2018, 3:04pm UTC


