Escape CharactersUse the backslash character to escape a single character or symbol. Only the character immediately following the backslash is escaped. Note: If you use braces to escape an individual character within a word, the character is escaped, but the word is broken into three tokens.
\ is a special character within a string used for escaping. "\" does now work because it is escaping the second " . To get a literal \ you need to escape it using \ .
To insert characters that are illegal in a string, use an escape character. An escape character is a backslash \ followed by the character you want to insert.
Javascript uses '\' (backslash) in front as an escape character. To print quotes, using escape characters we have two options: For single quotes: \' (backslash followed by single quote) For double quotes: \” (backslash followed by double quotes)
My program has a gtk.TreeView
which displays a gtk.ListStore
. The gtk.ListStore
contains strings like this:
"<span size='medium'><b>"+site_title+"</b></span>"+"\n"+URL
Where URL
is (obviously) a URL string. Sometimes there are characters in URL
that cause pango to fail to parse the markup.
Is there a way to escape URL
as a whole so that pango will just ignore it so it will be displayed literally? If not, how should I "escape" special characters in URLs?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With