Some notes about unicode...

Hubert Behaghel <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <20070819191145.GE22641@multivac>
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
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGyJXxgII0UD2emHwRAjZJAJoDs1OCnZjr8Uq3hNcaN0M2MWCzcQCeI0IK
7LeUW/Q5FuaDOlqZ8RgxnNI=
=AL1S
-----END PGP SIGNATURE-----
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.