Hey, 2009/6/15 dyblast <[email protected]> > > Hi, > I'm starting to use witty and I have some questions > isn't there a problem in SimpleChat? > Example(http://www.webtoolkit.eu/wt/examples/simplechat/simplechat.wt) > When I send a message containing a & the HTML formatting bugs ! Why? > It's normal? How to solve that?
It is intended, although perhaps sloppy: the built-in XSS prevention requires that contents that is displayed is valid XHTML (from which "active" content is filtered out). See http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WText.html. Invalid XHTML by default is displayed literally, as PlainText. The example could easily be changed to display the message literally as PlainText instead of the default XHTMLFormat. > Another question: > When i catch exception i would like show this error (using what()) in > the webpage so i use WString(ex.what()). But there is a problem with > special caracters like รด.They don't display correctly. is There a > function to correct this in Witty or I have to use std::use_facet widen > & cie...? You will need to make sure that you know what encoding you use to format the exception in the first place. When using WString(ex.what()), Wt will use your default encoding and use ::widen(). The best option in our opinion is to stick to UTF8 encoding for std::string's. Then you should use WString::fromUTF8(ex.what()) to properly display non ascii-7 characters. Hope this helps ! Regards, koen ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
