Skip to content
This repository has been archived by the owner. It is now read-only.

Exception: Characterset does not work for french Translation #317

Closed
macosforgebot opened this issue Feb 6, 2011 · 8 comments
Closed

Exception: Characterset does not work for french Translation #317

macosforgebot opened this issue Feb 6, 2011 · 8 comments

Comments

@macosforgebot
Copy link

@macosforgebot macosforgebot commented Feb 6, 2011

mail@… originally submitted this as ticket:409


I set Language to "fr" to test the localization.

2011-02-06 19:46:36+0100 [-] [mailgateway] 2011-02-06 19:46:36+0100 [-] [twext.web2.server#error] [Failure instance: Traceback: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xe0' in position 5: ordinal not in range(128)
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:345:errback
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:424:_startRunCallbacks
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:441:_runCallbacks
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:949:gotResult
2011-02-06 19:46:36+0100 [-] [mailgateway]      --- <exception caught here> ---
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:891:_inlineCallbacks
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/python/failure.py:338:throwExceptionIntoGenerator
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/resource.py:309:renderHTTP
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:891:_inlineCallbacks
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/python/failure.py:338:throwExceptionIntoGenerator
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twext/web2/static.py:127:renderHTTP
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:891:_inlineCallbacks
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/python/failure.py:338:throwExceptionIntoGenerator
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twext/web2/resource.py:109:renderHTTP
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twisted/internet/defer.py:893:_inlineCallbacks
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:334:http_POST
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:940:outbound
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/site-packages/twistedcaldav/mail.py:1029:generateEmail
2011-02-06 19:46:36+0100 [-] [mailgateway]      /usr/lib/python2.6/encodings/utf_8.py:16:decode
2011-02-06 19:46:36+0100 [-] [mailgateway]      ]

This can be reproduced by

>>> u"à".decode("utf-8")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 0: ordinal not in range(128)
@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Feb 6, 2011

mail@… originally submitted this as comment:1:⁠ticket:409


With

Index: CalendarServer/twistedcaldav/mail.py
===================================================================
--- CalendarServer/twistedcaldav/mail.py        (Revision 6892)
+++ CalendarServer/twistedcaldav/mail.py        (Arbeitskopie)
@@ -1024,10 +1024,6 @@
             else:
                 formatString = _("Event reply: %(summary)s")

-            # The translations we get back from gettext are utf-8 encoded
-            # strings, so convert to unicode
-            formatString = formatString.decode("utf-8")
-
             details['subject'] = msg['Subject'] = formatString % {
                 'summary' : details['summary']
             }

it works for me and the mails are nicely displayed. But maybe the have a bad encoding ...

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented May 2, 2011

mail@… originally submitted this as comment:2:⁠ticket:409


probably the same as #⁠442

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Aug 1, 2011

@wsanchez originally submitted this as comment:3:⁠ticket:409

  • Owner changed from @wsanchez to @m0rgen
  • Priority changed from 5: Not set to 2: Expected
  • Milestone set to CalendarServer-3.x
@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Aug 1, 2011

@wsanchez originally submitted this as comment:4:⁠ticket:409

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Aug 1, 2011

@wsanchez originally submitted this as comment:5:⁠ticket:409

  • Milestone changed from CalendarServer-3.x to CalendarServer-3.2
@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Dec 1, 2011

@wsanchez originally submitted this as comment:6:⁠ticket:409

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Sep 26, 2012

@m0rgen originally submitted this as comment:7:⁠ticket:409

  • Status changed from new to closed
  • Resolution set to Software changed

This code was changed fairly recently, and it should now be fixed.

@macosforgebot
Copy link
Author

@macosforgebot macosforgebot commented Sep 27, 2012

@wsanchez originally submitted this as comment:8:⁠ticket:409

  • Milestone changed from CalendarServer-3.2 to CalendarServer-4.x
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.