Re: hilghlighting



3rdShift wrote:

> Both Gtk::Label and Gtk::TextView support Pango markup which gives you
> more then enough to accentuate your text.
> 
> http://library.gnome.org/devel/pango/stable/PangoMarkupFormat.html
> 

A question rises here: this pango link is for C also gtkmm docs state
something I'm not sure is true.

"One of the benefits of UTF-8 is that you don't need to use it unless you
want to, so you don't need to retrofit all of your code at once.
std::string will still work for 7-bit ASCII strings. But when you try to
localize your application for languages like Chinese, for instance, you
will start to see strange errors, and possible crashes. Then all you need
to do is start using Glib::ustring instead.

Note that UTF-8 isn't compatible with 8-bit encodings like ISO-8859-1. For
instance, German umlauts are not in the ASCII range and need more than 1
byte in the UTF-8 encoding. If your code contains 8-bit string literals,
you have to convert them to UTF-8 (e.g. the Bavarian greeting "Grüß Gott"
would be "Gr\xC3\xBC\xC3\x9F Gott")."
http://library.gnome.org/devel/gtkmm-tutorial/unstable/sec-basics-ustring.html.de

I think currently most systems are utf and are using (8bit) utf by default
and I have never had to think about it in the past few years.
about 5years ago it was a nightmare

----------
example : cat test.cc

#include <string>
#include <iostream>
using namespace std;

int main () {
        string a = "Test ascii";
        string b = "Grüß Gott!";

        cout << "A test: " << a << endl;
        cout << "German: " << b << endl;
return 0;
}

./a.out
A test: Test ascii
German: Grüß Gott!

----------
regards



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]