2
4

2 回答 2

1

You need to UTF-8 encode it, since GTK+'s encoding is UTF-8.

Thus:

const char bullet_utf8[] = "\xe2\x80\xa2";
gtk_text_buffer_insert_at_cursor(textBuffer, bullet_utf8, strlen(bullet_utf8));

You can see the UTF-8 encoding of this character here, for instance.

于 2012-04-17T09:47:40.417 回答
1

How can I translate u'\u2022' from Python to C?

If you are using c++ compiler to build it, and the compiler have spec c++0x or c++11 (you can specify with g++ -std=c++0x), you can write the code like following.

gtk_text_buffer_insert_at_cursor(textbuffer, u8"\u2022", -1);
于 2012-04-19T03:25:43.637 回答