Diacritics are bad printed to screen

Hello,
I would like to know why diacritic does not display satisfactorily. For example, on this screenshot (imagik.fr/view-rl/211782), grace accent (on the second “e” of entière) is rendering badly. Same thing with acute accent, etc. Do you know how imporve this rendering?
Thanks

Because the accents are an emulation. But now you can directly use characters with accent from your keyboard. It should work.

It does not work with keyboard. See this screenshot (imagik.fr/view-rl/211816); there is problème with first “e” of “Modélisation”. I noted that I cannot enter character with diacritic into terminal; I have to use subroutine to get this picture. A problem with character encoding? I use ROOT version 5.26/00b and UTF-8.

I’ll look …

For me it is working with the latest root version. The attached macro produces the attached picture.
accent_encoding.C (217 Bytes)


Do you use french keyboard or other one? What is you character encoding? Can you type character with diacritic in ROOT terminal or do you use subroutine?

I am using the american keyboard in the US International mode. But a French keyboard should be the same. Is the macro I sent you working for you ?

I think I have to use TLatex to write my text. Indeed, if I type this line

I have encoding problem. I will check with TLatex. Could you say me how use TLatex to write title and axis name of an histo?

This macro works for me so I think problem is I do not use TLatex.

Axis title are already drawn using TLatex … the bad accent you do not like is produced by TLatex… but that’s difficult to make it better … as I said that’s an emulation made with a line (to draw the accent).

I do not understand. Your script which use TLatex displays correctly diacritics but axis title which use also TLatex displays badly diacritics. Where is the problem? Why is rendering different between your scipt and axis title?

Look here:
root.cern.ch/root/html/TLatex.html#L8
This is the “emulation way” used by default by TLatex. It uses the special commands for the accents. You can see it is not very good. To really have è or à or é you can type the real character with accents like with the French keyboard or the US one in international mode. That is what my macro does. It is 2 different ways to get accents but both are done using TLatex. Note that the 2nd way also work with TText.

Ok, so my problem is why “é” displays as “é” whereas “é” displays correctly in your script.

My favorite editor on unix (Mac OSX) is “vi”. When I type the character é using this editor it appears as é. I turned my keyboard into US international so to produce “é” I first type a single quote, followed by a “e”. When I execute the macro in ROOT, é also appear correctly on the screen. May be the way you entered the character é in macro is wrong. I am sure other editors works also fine… I have not tried them all. Unfortunately I do not have a real French keyboard to try.

Problem come from character encoding. I use Mandriva 2010.0 and I use option “Compatibility with old encoding (non UTF-8)” and now I can use character with diacritics. It displays correctly (see imagik.fr/view-rl/212922). So I guess problem is related to encoding character. ROOT does not use UTF-8. Is it right?

Surely …

Does it plan to implement this UTF-8 support in the next versions?

I am not entirely sure what you mean by that . So I guess the answer is no.

[quote=“couet”]Unfortunately I do not have a real French keyboard to try.[/quote]You can easily change the layout from the keyboard menu. Or you can try the following commands (linux commands, but seem compatible with MacOS) :

setxkbmap fr setxkbmap us
to switch between US and FR layouts. Keys ‘1’, ‘7’ and ‘0’ should print respectively ‘é’, ‘è’ and ‘à’ under the FR layout. The point is that such characters are not recognized by ROOT (though they are by CINT), so you cannot even enter them into a ROOT prompt (at least when the locale is set to UTF8, but I quickly (wrongly ?) tried iso8895-1 without success). The same issue obviously occurs when you try to input chinese or whatever other language.

Your macro works fine because it is encoded in iso8859-1 (latin1), as you can see from the following vim command :

or by the following command in a GNU/linux terminal :

So a workaround is to convert macros to iso 8859-1. Under GNU/linux, one can use the “iconv” command :

or under vim :

[quote=“couet”]I am not entirely sure what you mean by that.[/quote]One may translate by “does ROOT plan to use a (somehow obsolete and) limited encoding forever ?” :stuck_out_tongue:

More seriously, as ROOT is used worldwide, switching to UTF-8 (and thus improving internationalization) seems to me a necessary improvement.

[quote=“pamputt”]I use Mandriva 2010.0 and I use option “Compatibility with old encoding (non UTF-8 )” and now I can use character with diacritics. It displays correctly (see imagik.fr/view-rl/212922).[/quote]I guess from google that you used localedrake ? I would be interested to find the equivalent for Fedora, if anybody knows.

Using Qt layer seems to be another workaround, if I understand correctly some posts by Valeri Fine in the forum.

[quote=“berder”]

[quote=“pamputt”]I use Mandriva 2010.0 and I use option “Compatibility with old encoding (non UTF-8 )” and now I can use character with diacritics. It displays correctly (see imagik.fr/view-rl/212922).[/quote]I guess from google that you used localedrake ? I would be interested to find the equivalent for Fedora, if anybody knows.

Using Qt layer seems to be another workaround, if I understand correctly some posts by Valeri Fine in the forum.[/quote]Yes, it should work for you (see root.cern.ch/phpBB2/viewtopic.ph … inese+font )