Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9072195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:06:39+00:00 2026-06-16T18:06:39+00:00

I have UTF-8 string: Website • Facebook That is a bullet in the middle

  • 0

I have UTF-8 string: Website • Facebook
That is a bullet in the middle aka • or 0xE2 0x80 0xA2

This value is correctly stored in the database and correctly displayed on screen using Rails 3 and ruby 1.9.3 using the default settings.

I am attempting to send this via HTML email, but when all is said and done, the receiving end sees garbage:

enter image description here

The code behind this is simple, I have an ActionMailer subclass (which uses UTF-8 by default) setup to send an HTML email with UTF-8 content encoding in the layout:

email.html.erb layout file:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=9" />       
    <meta charset="utf-8">
    <%= stylesheet_link_tag "application", :media => "all" %>       
</head>
<body class='email'>
    <%= yield %>                        
</body>
</html>

The content uses the same views that render the webpage, with the important line being:

<p><%= simple_format strip_tags(comment.text) %></p>

I have tried many many permutations of force_encoding, encode, applying redundant UTF-8 encoding to the ActionMailer subclass, the top of the view file and about a dozen other things, but nothing seems to work.

The important HTML, as viewed by the raw html message through Apple Mail is:

Website =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD Facebook

If you take a look at the raw message (linked above), this does not occur on the text-only message, only the HTML one.

TL;DR

ActionMailer is replacing what should be a UTF-8 bullet character:0xE2 0x80 0xA2
with garbage: 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD 0xEF 0xBF 0xBD

How can I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:06:40+00:00Added an answer on June 16, 2026 at 6:06 pm

    Check if you are using a gem for inlining CSS, like premailer-rails3.

    According to this post, this may corrupt UTF-8 characters in your ActionMailer emails.

    Try either removing or replacing the gem with something like the actionmailer_inline_css gem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

C# question here.. I have a UTF-8 string that is being interpreted by a
I have string that displays UTF-8 encoded characters, and I want to convert it
Suppose I have this code: String encoding = UTF-16; String text = [Hello StackOverflow];
I have some problem to get the utf-8 string from PHP using jQuery $.load()
I have created a function which gets an encoded string (possibly UTF-16 not sure)
I have model: # encoding: utf-8 class Tag include Mongoid::Document field :name, type: String
I have a string \\u003c, which belongs to UTF-8 charset. I am unable to
Say I have the following line in a method: String encodedString = URLEncoder.encode(foo, utf-8);
I want to read UTF-8 strings from a server that I have control of,
I have started writing an application that gets in a certain website and gets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.