On Mon, Sep 6, 2010 at 11:19 PM, Paul McNett <[email protected]> wrote:
>
> On 9/6/10 7:49 PM, Mark Rajcok wrote:
> > How do I make my Dabo app use UTF-8 everywhere? (The user may want to copy
> > some of the text from the dHtmlBox and paste it into a dTextBox, and then
> > into an Sqlite DB -- the DB is already set for UTF-8 encoding.)
>
> Dabo uses the default locale as set in python's locale module. Python uses
> whatever
> the platform is set up for.
>
> > I tried setting self.Application.Encoding to 'Unicode' in the main form's
> > afterInitAll(), but I received 'AttributeError: can't set attribute.' So
> > far I'm only using ClassDesigner (if that matters). I'm pulling the web
> > page into the Dabo app using urllib.urlopen(). I then assigning a portion of
> > the page (filteredPage) to dHtmlBox.Source
>
> Try this, at the beginning of your application, before importing dabo:
>
> import locale
> locale.setlocale(("en_US", "UTF8"))
Thanks Paul. That didn't work. My workaround (which is good enough)
is to use decode. That doesn't get my UTF-8 everywhere, but at least
it gets the text to display well enough in my dHtmlBox:
... HtmlBox.Source = filteredPage.decode('UTF-8')
-- Mark
>
> Of course this assumes you are in the US.
>
> Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]