You have to configure your locale support in etc/zope.conf properly.


--On 30. September 2005 00:26:14 +0200 Maurits van Rees <[EMAIL PROTECTED]> wrote:


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":

- This will render literally: "Zöpe website":

[Notice the diaeresis in the second case.]

This can of course be solved by using html entities like '&ouml;'.
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 '&ouml;', 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 """
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

Let's link to a "Zope website":

Nó. Let's lïnk to à "Zöpe website":

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:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

<p>Let's link to a <a href="";>Zope website</a>.</p>
<p>Nó. Let's lïnk to à "Zöpe website":</p>


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.


Maurits van Rees | [Dutch/Nederlands]
Public GnuPG key:
"It can seem like you're doing just fine,
but the creep's creeping into your mind." - Neal Morse

Attachment: pgpE7wLdPn1AU.pgp
Description: PGP signature

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to