On Tue, Jan 09, 2007 at 09:57:12PM +0100, Georg Baum wrote:
> Am Dienstag, 9. Januar 2007 21:42 schrieb Enrico Forestieri:
> > On Tue, Jan 09, 2007 at 07:46:47PM +0100, Georg Baum wrote:
> > > José or any other python expert, I need your help. The attached patch
> is
> > > the lyx2lyx part of the "getting rid of InsetLaTeXAccent" patch.
> > > convert_accent works well, but revert_accent does not. I put the error
> > > messages in the file. Can anybody tell me why
> > >
> > > document.body[i] = unicodedata.normalize("NFKD", document.body[i])
> > >
> > > does not work?
> >
> > result = unicodedata.normalize("NFKD",
> unicode(utf8encodedstring, 'utf8'))
> >
> > works fine here.
>
> How edid you set utf8encodedstring?
I used the attached script.
> Is that with my test document (first converted to 257 and then back)?
No, I didn't try your patch.
> What python version? I use 2.4.4.
Works with python 2.3.3 on solaris and 2.4.3 on cygwin.
--
Enrico
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
result = unicodedata.normalize("NFKD", unicode("olà", 'utf8'))