Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Sending Mails with mutations ä,ü,ö
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Adam Meyer  
View profile   Translate to Translated (View Original)
 More options 4 Nov, 22:28
From: Adam Meyer <rails-mailing-l...@andreas-s.net>
Date: Wed, 4 Nov 2009 23:28:51 +0100
Local: Wed 4 Nov 2009 22:28
Subject: Sending Mails with mutations ä,ü,ö
Hi everyone

I am sending mails with rails in German. The Problem is that the German
letters ä,ü,ö are arriving correctly at the receiver.

When the subject contains the word

Für

the receiver gets

Für

Does anybody knows this issue?

Thanks in advance.

Adam
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
T. N.t.  
View profile   Translate to Translated (View Original)
 More options 4 Nov, 22:39
From: "T. N.t." <rails-mailing-l...@andreas-s.net>
Date: Wed, 4 Nov 2009 23:39:30 +0100
Local: Wed 4 Nov 2009 22:39
Subject: Re: Sending Mails with mutations ä,ü,ö

Adam Meyer wrote:
> Hi everyone

> I am sending mails with rails in German. The Problem is that the German
> letters ä,ü,ö are arriving correctly at the receiver.

> When the subject contains the word

> Für

> the receiver gets

> Für

> Does anybody knows this issue?

This is strange. ActionMailer (or is it TMail?) should encode this
correctly like =?utf-8?Q?=C3=84=C3=96=C3=9C?= (this is ÄÖÜ). For me it
does it very well. What version do you use and what is your code?

Regards, T.

--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Meyer  
View profile   Translate to Translated (View Original)
 More options 4 Nov, 22:49
From: Adam Meyer <rails-mailing-l...@andreas-s.net>
Date: Wed, 4 Nov 2009 23:49:57 +0100
Local: Wed 4 Nov 2009 22:49
Subject: Re: Sending Mails with mutations ä,ü,ö

I am riding on 2.2.2 with Actionmailer and my code is

  def invoice(kwiker, url, name)
    setup_email(kwiker)
    @subject    += 'Rechnung für Bestellung bei kwikit.de Grusskarten'
    @body[:url]  = "http://#{APP_CONFIG['site_host']}/"

    part :content_type => "text/plain", :body =>
render_message("invoice.html.erb", body)

    attachment :content_type => "application/pdf",
               :body => File.read(url),
               :filename => name
  end

and this is in my production.rb

   ActionMailer::Base.delivery_method = :smtp

   ActionMailer::Base.perform_deliveries = true
   ActionMailer::Base.raise_delivery_errors = true
   ActionMailer::Base.default_charset = "utf-8"
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
T. N.t.  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 08:12
From: "T. N.t." <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 09:12:49 +0100
Local: Thurs 5 Nov 2009 08:12
Subject: Re: Sending Mails with mutations ä,ü,ö

Adam Meyer wrote:
> ...
> I am riding on 2.2.2 with Actionmailer and my code is

I have 2.3.4; maybe it's a new feature that the headers are quoted
automatically.

For now you could do it by hand. Somewhere in the TMail module must be
the function to make RFC 2231 headers. I can't find it now. So a
temporary solution was:

     @subject = "=?utf-8?Q?#{[@subject].pack("M").chomp}?="

A more advanced function would break longer strings into multiple lines.

Hope this helps, T.
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Meyer  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 09:02
From: Adam Meyer <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 10:02:52 +0100
Local: Thurs 5 Nov 2009 09:02
Subject: Re: Sending Mails with mutations ä,ü,ö

hmm... but its not only in the subject. its in body too.

I am scared to update my rails, I dont want my app to break down
completely.
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin Law  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 09:11
From: Colin Law <clan...@googlemail.com>
Date: Thu, 5 Nov 2009 09:11:32 +0000
Local: Thurs 5 Nov 2009 09:11
Subject: Re: [Rails] Re: Sending Mails with mutations ä,ü,ö
2009/11/5 Adam Meyer <rails-mailing-l...@andreas-s.net>:

You should not be scared to try an update, specify version 2.2.2 in
environment.rb (or freeze 2.2.2 into the app), install the later
version of rails and modify your app on a branch in your version
control system (I prefer git) so you can experiment without affecting
your working code.  Then when all is working on the branch simply
merge it into the trunk.

Colin
Colin


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
T. N.t.  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 09:57
From: "T. N.t." <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 10:57:00 +0100
Subject: Re: Sending Mails with mutations ä,ü,ö

Adam Meyer wrote:
> hmm... but its not only in the subject. its in body too.

I don't know what @body[:url] is, but for

   part :content_type => "text/plain",
    :body => render_message("invoice.html.erb", body)

you probably should say :content_type => 'text/plain; charset=utf-8'

T.
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Meyer  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 09:58
From: Adam Meyer <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 10:58:43 +0100
Local: Thurs 5 Nov 2009 09:58
Subject: Re: Sending Mails with mutations ä,ü,ö

T. N.t. wrote:
> Adam Meyer wrote:
>> hmm... but its not only in the subject. its in body too.

> I don't know what @body[:url] is, but for

>    part :content_type => "text/plain",
>     :body => render_message("invoice.html.erb", body)

> you probably should say :content_type => 'text/plain; charset=utf-8'

> T.

@body[:url] is just a value I want to use in the email template.
Your solution might work in the body, but what is with the subject?
--
Posted via http://www.ruby-forum.com/.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
T. N.t.  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 11:39
From: "T. N.t." <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 12:39:58 +0100
Local: Thurs 5 Nov 2009 11:39
Subject: Re: Sending Mails with mutations ä,ü,ö

 @subject = "=?utf-8?Q?#{[@subject].pack("M").chomp}?="

Didn't you try it?

T.
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marnen Laibow-Koser  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 13:04
From: Marnen Laibow-Koser <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 14:04:39 +0100
Local: Thurs 5 Nov 2009 13:04
Subject: Re: Sending Mails with mutations ä,ü,ö
Adam Meyer wrote:

[...]

> I am scared to update my rails, I dont want my app to break down
> completely.

That's why you have comprehensive automated tests!  Just make sure that
all tests pass after you upgrade.

(You *do* have tests, right?  If not, write some right away.)

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Meyer  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 17:25
From: Adam Meyer <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 18:25:11 +0100
Local: Thurs 5 Nov 2009 17:25
Subject: Re: Sending Mails with mutations ä,ü,ö

I don't know what is happening in you code, but it works.
Thanks!

--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
T. N.t.  
View profile   Translate to Translated (View Original)
 More options 5 Nov, 19:12
From: "T. N.t." <rails-mailing-l...@andreas-s.net>
Date: Thu, 5 Nov 2009 20:12:38 +0100
Local: Thurs 5 Nov 2009 19:12
Subject: Re: Sending Mails with mutations ä,ü,ö

Adam Meyer wrote:
> I don't know what is happening in you code, but it works.
> Thanks!

Honestly, I also don't understand this pack command, but what happens
is, that it encodes the string as quoted-printable. In

  =?utf-8?Q?string?=

utf-8 is obviously the charset/encoding, Q is the way the bytes are
represented with 7-bit characters, which is quoted-printable (Q) or
base64 (B) and then comes obviously the string. So instead of that
cryptic ['string'].pack("M").chomp you could also do

  "=?utf-8?B?#{Base64.b64encode(@subject).chomp}?="

But quoted-printable is more adequate for european texts.

T.
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google