How to use the utf8 Japanese characters in ROOT Session?

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

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=“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.

$ root

Then start a ROOT Session.

  *                                         *
  *        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.

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.

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 )

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

I copy and paste the line I have selected.

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.

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)


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

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.

1 Like

[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

1 Like

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

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.

1 Like