Subtle Question About Incorrect Unicode Encoding

Hi experts, I have a rather subtle question about using Unicode Characters in my title. I wish to use the plus-minus sign, which is \u00B1. It prints out alright in the terminal, yet when I try to put it on my histogram title using SetTitle(), a weird looking
Screenshot 2025-06-17 162313
was produced instead. The title was originally created as a string, and it had to be converted into a char using the c_str() method when fed into SetTitle(). Any idea how to remove this A hat? Thanks in advance.

Hi,

root [0] const string str_myTitle {"Title 5#pm2"};
root [1] TH1F* myH {new TH1F {"myH", str_myTitle.c_str(), 10, 0, 10}};
root [2] myH->Draw()

1 Like