python - How to properly escape output (for XHTML) in mako? -


Despite giving a good way to avoid the output using filters, none of them does the right thing to take the string :

  x = u "and \ u0092"  

filters do the following:

  X & amp; In one unit but not \ u0092 (not valid XML but XHtml) h is actually the same u escape, but explicitly the use of organizations avoiding URLs only converts named entities, then only & amp; HDML uses the standard Unicode Consortium Character Reporter, and it misses the undefined (between the other) 65 character code (from 0 to 31 and from 127 to 159). Inclusive)   

It seems that the characters will be remembered. Any ideas?

edit

It seems that if I use file offline it can be a content-type problem?

Unicode character for & amp; #xxxx; To work in form HTML, unless you intentionally are not using ASCII charsets, it is simpler and more efficient to avoid designated entities, then convert the entire string into symbolic words in UTF-8 and that Write it the way. You might be either in the HTTP header or & lt; Meta & gt; should use encoding in the tag.

Edit:

Is it valid that if I use the file offline it may be a content-type problem ?

Yes you can either use the HTTP headers to apply UTF-8 charsets or specify directly in HTML via meta tags:

< Pre> & lt; Meta http-equiv = "content-type" content = "app / xHTML + XML; charset = UTF-8" />

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -