Re: Some notes about unicode...

domellen <xlii-bcjjI7LfS/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <p06240802c2ef88b74b45@[10.0.1.211]>
Hello,

I posted the locale "bug" which in fact is 
apparently NOT a bug in Python but an issue with 
the OS distribution (see comment on the tracker).

My project is similar to Hubert's. I am trying to 
transfer three French blogs from a PHP based 
system to pyblosxom. The character set issue is 
complex and we have been studying it for quite a 
while. An important part of our site is generated 
with homemade Python scripts. It is entirely in 
utf-8 and we can thus write and do searches in 
any language, greek, japanese and russian 
included.

I'm setting up my new blogs in utf-8 and once we 
get everything running, I'll document what we did 
in detail. For now (with some very small 
modifications), we can put accents anywhere, even 
in directory names :-) so that the category names 
are spelled correctly, for instance "Générale". 
My test blog's name contains an accent and 
comments are fine, as are the plugins pyarchives 
(with accents in the names of months), 
pycategories and pygallery. And that little "u" 
is there:

# What is the title of this blog?
py["blog_title"] = u"Il était une fois"

For Hubert: the common accents are all present in 
the ISO-8859-1 character set so it may be 
sufficient for your needs and you'll have no need 
to use utf-8 or the "u" prefix. But you will have 
trouble with the oe ligature.

domellen


At 17:36 -0400 2007.08.19, Will Guaraldi wrote:
>The locale issue was recently reported as a bug, but I wasn't able to
>reproduce it.  Your observations on that issue are hugely useful--that
>explains a lot of things.
>
>In regards to the blog_description issue, can you submit a bug report
>along with the traceback so that someone can track it down?
>
>If you have any other problems, please submit bug reports for those as
>well.  That helps us fix things and increases the quality for
>PyBlosxom.
>
>Thanks!  Good luck with your new blog!
>
>/will
>
>
>On 8/19/07, Hubert Behaghel <[email protected]> wrote:
>>  Hi there,
>>
>>  I am working on my future blog which will be powered by pyblosxom. To be
>>  clear, I am quite new to python but this is something I'd like to change
>>  and this is partly why I am choosing pyblosxom.
>>
>>  Another point, I am french and would like to blog in both language :
>>  french and english. But for the moment, let's say I only want to see my
>>  blog speaking french.
>>
>>  I use it through apache2 on a Gentoo-Linux x86 32bits box where
>>  everything is in utf-8.
>>
>>  I recently downloaded v1.4.1. At first, I had problem with locale; to
>>  deal with date computing, some part of pyblosxom set locale to 'C' then
>>  restore former setup but the restore couldn't work for some obscure
>>  reason to me. In my environment, in module locale.py, the resetlocale()
>>  function was throwing the same error so I assumed that this was the same
>>  problem. I eventually found a bug that was solved in python 2.5.1. So I
>>  upgraded and that solved this problem.
>>
>>  I have spent a couple of days trying to understand why my blog could
>>  render a page with many entries (e.g. the base url or a category url),
>>  but couldn't render a single entry with its comments. As said before,
>>  this a french blog, that is to say with a lot of accents everywhere...
>  > My blog threw a KeyError when calling urllib.quote() while rendering any
>>  entry. Looking further (with a very very naive debugging approach), I
>>  discovered that it came from my blog_description that does contain
>>  accents. Looking closely to it, I couldn't see anything wrong... But it
>>  was clear that with no accent at all, this variable would let the whole
>>  blog work like a charm... Needless to say that giving up with those
>>  accents was beyond myself: so I was sad and didn't want to upset my new
>>  friend python with words like 'dotclear', 'typo', 'blogger.com'... But
>>  suddenly, I just removed that 'u' you have in front of unicode string in
>>  my declaration :
>>  py['blog_description'] = u'Ma description accentuée'
>>  so it became :
>>  py['blog_description'] = 'Ma description accentuée'
>  > And by the way : it works !
>>
>>  So I just wanted to say something to 'u', oh no, my friend I don't like
>>  'u', in fact... I hate 'u'.
>>
>>  Seriously, I wanted to share those episods of my preblogging life with
>>  you in case you would have something to say :
>>   - about locale, python and pyblosxom
>>   - about french blogging
>>   - about 'u'...
>>
>>  Thank you in advance and sorry if this mail looks insane, I am sure
>>  u^Hyou understand.
>>
>>  --
>>  Hubert
>>
>>  -------------------------------------------------------------------------
>>  This SF.net email is sponsored by: Splunk Inc.
>>  Still grepping through log files to find problems?  Stop.
>>  Now Search log events and configuration files using AJAX and a browser.
>>  Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>  _______________________________________________
>>  pyblosxom-users mailing list
>>  pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>>  https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
>>
>>
>>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >>  http://get.splunk.com/
>_______________________________________________
>pyblosxom-users mailing list
>pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/pyblosxom-users


-- 
Quarante-Deux : quelques pages sur la Science-Fiction
Ellen C. Herzfeld - Dominique O. Martel
http://www.quarante-deux.org/
En librairie : Axiomatique de Greg Egan
http://www.amazon.fr/exec/obidos/ASIN/2843440734/quarantedeux-21

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.