That snippet came from here in case you need to see more of the example: http://wiki.k4ml.com/python/webpy ________________________________________________________ http://www.superantispyware.com/superantispyware.html?rid=3971 Remove All The Spyware - Not Just The Easy Ones! http://1-4-u.info | Don't send insanely long links! Need a Pick-Me-Up? http://quotes.feedtheguru.com
On Wed, Aug 4, 2010 at 11:12 AM, Greg Milby <[email protected]> wrote: > Do you think applying your notfound this way would help force the utf-8 > encoding? > > def GET(self, name): > page = os.path.join(wikidir,name) > *web.**header**(**"**Content**-**Type**"**,**"text/html; > charset=**utf**-**8**"**)* > if os.path.exists(page): > print "<html><head><title>%s</title></head><body>" % > name > print "<h1>%s</h1>" % name > > ________________________________________________________ > http://www.superantispyware.com/superantispyware.html?rid=3971 Remove All > The Spyware - Not Just The Easy Ones! > http://1-4-u.info | Don't send insanely long links! > Need a Pick-Me-Up? http://quotes.feedtheguru.com > > > > On Wed, Aug 4, 2010 at 11:08 AM, boubou_cs <[email protected]> wrote: > >> Hi, >> >> I found a way to customize the page notfound using a template: >> >> In code.py: >> >> def notfound(): >> return web.notfound(render.notfound("")) >> >> app.notfound = notfound >> >> Then in the template folder i added a notfound.html : >> >> $def with (text) >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> >> "http://www.w3.org/TR/html4/strict.dtd"> >> <html> >> <head> >> <title>404 Not Found</title> >> </head> >> >> <body> >> <h1>Not Found</h1> >> <p>$text </p> >> <hr> >> >> </body> >> </html> >> >> when I need to call web.notfound, simply add the desired text this >> way: >> >> raise web.notfound("Cette page ne peut être accessible.") >> >> However, I can not display the text with European accents. >> My text appears like this: >> >> Cette page ne peut A²tre accessible >> >> Any idea? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "web.py" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected] <webpy%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/webpy?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
