Charset

Hi all,
Is there a way to have text in different charset?
I need iso-8859-2…

best regards,
jimmij

Hi jimmij,
I assume you’re referring to const char* strings? Check std::setlocale or setlocale. Also, you can specify universal characters using the \uNNNN or \UNNNNNNNN notation, where each N stands for a hex digit, and the first version assumed the hex character name to be 0000NNNN. But what you get is not always what you see - you might have to change the system’s locale, e.g. in linux using $LANG etc.
Axel.

Thanks for answer,

#include <locale.h>
setlocale(LC_ALL, "pl_PL.ISO-8859-2");

it works for me, but only in terminal.
I need iso-8859-2 on canvas (ie. in TLegend or TPaveText).

All my system locales are set on 8859-2 and in other applications I have what I need, so I think I should set something else in root’s script… but what?

regards,
jimmij

Hi jimmij,
we had a similar post concerning a russian charset. See http://root.cern.ch/phpBB2/viewtopic.php?t=1512, maybe that helps you a bit.
Axel.

Hi again,
I have changed all iso-8859-1 to iso-8859-2 in $ROOTSYS/etc/system.rootrc but it seems to do nothing. And I’m not sure if this change should do anything in my case because AFAICS there are only GUI fonts declaration (ie. menu, status bar,…).

thanks for help,
jimmij

Look up the Qt layer implementation (mentioned by root.cern.ch/phpBB2/viewtopic.php?t=1512 )

root.bnl.gov/QtRoot/htmldoc/src/ … #TGQt:Init

One can see it uses

gEnv->GetValue(“Gui.DefaultFont”, “-adobe-helvetica-medium-r---12-----*-iso8859-1”);

to manage the font codepage that is used within TCanvas also :unamused: .

This means “Gui.DefaultFont” is applied for TCanvas component also.
(TAxis, TText, TPaveLabel etc )

One may disregard the font size and pitch because they are to be changed by TCanvas at run time anyway. However the code page will persist :bulb: .

[quote=“jimmij”]I have changed all iso-8859-1 to iso-8859-2 in $ROOTSYS/etc/system.rootrc but it seems to do nothing.[/quote] Are those fonts installed on your system? If you don’t know read the link I posted: it explains how to find out, and how to add the fonts.
Axel.

yes. When I change name of some directory to another within iso8859-2 specific letters, and then in root go into this directory using TBrowser I can properly see name of that directory on the status bar. So I think fonts are ok.

It seems that I have no choice :wink:

regards,
jimmij