Hi, I have a problem getting links to function in StructuredText when they have non-ascii characters in the title.
- This will render as a link: "Zope website":http://zope.org/ - This will render literally: "Zöpe website":http://zope.org/ [Notice the diaeresis in the second case.] This can of course be solved by using html entities like 'ö'. But I have just started using utf-8 so I don't have to bother myself with writing html entities. There is probably a Python method that can translate 'ö' into 'ö', but I would like the resulting html code to be humanly readable utf-8 as well. I wouldn't mind iso-8859-1 as that's what it basically is in my case (I'm Dutch) but utf-8 seems the way to go. Anyway, here is a script that illustrates the problem. It has some extra non-ascii characters thrown in just to show that these characters don't give any problems outside of the links. ------------------ import Products.PythonScripts.standard print """ <html><head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head><body> """ text=""" Let's link to a "Zope website":http://zope.org/. Nó. Let's lïnk to à "Zöpe website":http://zope.org/. """ ppss=Products.PythonScripts.standard.structured_text print ppss(unicode(text, 'iso-8859-1').encode('utf-8')) # The following line has the same effect: #print unicode(ppss(text), 'iso-8859-1').encode('utf-8') print "</body>" return printed ------------------ Don't worry, this is not how I usually make my pages. ;-) This results in the following html source code: ------------------ <html><head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head><body> <p>Let's link to a <a href="http://zope.org/">Zope website</a>.</p> <p>Nó. Let's lïnk to à "Zöpe website":http://zope.org/.</p> </body> ------------------ That last failed link is obviously not as it should be. Does anyone know a solution? I failed to find one with Google. I wondered if it had to do with the diaeresis specifically, but the same thing goes wrong with e.g. 'Zópe'. BTW, I use the Debian Sarge version of Zope 2.7. Thanks, -- Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] Public GnuPG key: http://maurits.vanrees.org/var/gpgkey.asc "It can seem like you're doing just fine, but the creep's creeping into your mind." - Neal Morse
Description: Digital signature
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )