{"id":3222,"date":"2020-04-27T12:02:21","date_gmt":"2020-04-27T12:02:21","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3222"},"modified":"2020-04-27T12:16:05","modified_gmt":"2020-04-27T12:16:05","slug":"special-characters","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/gui-programming-in-c\/gtk\/text\/special-characters","title":{"rendered":"Special Characters"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">GTK Special Characters<\/h4>\n\n\n\n<p>The following characters need escaping: &amp;, &lt;, &gt;<\/p>\n\n\n\n<p>You can use g_markup_escape_text() to do it, e.g.:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tstrcpy(temp_string, KEYBOARD_TEXT_SPAN_MARKUP);\n\tstrcat(temp_string, g_markup_escape_text(&amp;edit_text&#91;0], -1));\t\t\/\/g_markup_escape_text will escape any special (&amp;, &lt;, >) characters in your string \n\tstrcat(temp_string, \"&lt;\/span>\");\n\tgtk_label_set_markup(GTK_LABEL(lblKeyboardText), temp_string);\n\n\/\/or\n\n\tstrcpy(temp_string, KEYBOARD_TEXT_SPAN_MARKUP);\n\tstrcat(temp_string, g_markup_escape_text(MyString.c_str(), -1));\t\t\/\/g_markup_escape_text will escape any special (&amp;, &lt;, >) characters in your string \n\tstrcat(temp_string, \"&lt;\/span>\");\n\tgtk_label_set_markup(GTK_LABEL(lblKeyboardText), temp_string);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GTK Special Characters The following characters need escaping: &amp;, &lt;, &gt; You can use g_markup_escape_text() to do it, e.g.:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[109,105],"tags":[],"class_list":["post-3222","post","type-post","status-publish","format-standard","hentry","category-labels","category-text"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3222"}],"version-history":[{"count":2,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3222\/revisions"}],"predecessor-version":[{"id":3225,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3222\/revisions\/3225"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}