Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html entities converted erroneously #92

Closed
bigpupil opened this issue Oct 31, 2011 · 17 comments
Closed

html entities converted erroneously #92

bigpupil opened this issue Oct 31, 2011 · 17 comments

Comments

@bigpupil
Copy link

Symbols like the registration mark are being converted and showing up as boxes with question marks in them, rendering premailer generated markup unusable. Please correct so premailer functions as it previously did, where html entities where left as is.

@Studly
Copy link

Studly commented Nov 1, 2011

I'm having this same problem with HTML code like:
  (non breaking space)
© (copyright symbol)

Premailer converts it into a funky character, which in an email client shows up as a question mark in a diamond. Premailer didn't use to do this ... just started about a month ago for me.

@Studly
Copy link

Studly commented Nov 1, 2011

In my post above, I pasted the HTML for non breaking space and copyright, but it's not showing the code ... it just shows the character. But basically premailer is having a problem with HTML code that begins with "&" such as the code for non breaking space and the code for copyright symbol.

@refringe
Copy link

refringe commented Nov 2, 2011

It's decoding HTML entities. And I agree, it shouldn't.

@egid
Copy link

egid commented Nov 3, 2011

My hacky solution for this is to remove the charset from the meta header tag. I had UTF-8 prior and it would screw it all up.

Here's how I'm rolling for now: <meta http-equiv="Content-Type" content="text/html" />

@bigpupil
Copy link
Author

bigpupil commented Nov 4, 2011

That IS a hacky egid workaround. Better than inlining your own styles I guess. Ok so it seems the error pre mailer is experiencing is related to the way it is treating the document because of how it's enterpeting (or misenterpreting) the doctype. Anyone have suggestions for a fix?

@egid
Copy link

egid commented Nov 4, 2011

As a side note, my hack also solves the problem of the #&13; carriage return encoding at the end of every line. I'm just a web guy, so I unfortunately can't offer any insights into the workings of the premailer.

@joevandyk
Copy link

I think the reason for this is premailer forcing the encoding to ASCII-8BIT. I'm not sure why it's doing that.

@mehas
Copy link

mehas commented Dec 6, 2011

My hacky solution for this is to remove the charset from the meta header tag. I had UTF-8 prior and it would screw it all up.

Here's how I'm rolling for now: <meta http-equiv="Content-Type" content="text/html" />

This sort of works, but changes the encoding. For example, &#8211; (en dash) is changed to &#x2013;.

@olivierlacan
Copy link

Same problem here. Straight UTF-8 characters produce errors, and HTML entities too.

@tomblomfield-zz
Copy link

I'm having this problem too.

£ gets encoded as =EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD

💩

@mehas
Copy link

mehas commented Mar 19, 2012

for now I switched to the Mailchimp CSS Inliner tool: http://beaker.mailchimp.com/inline-css

@refringe
Copy link

I've been using the Mailchimp tool as well. Premailer has, unfortunately, been unusable for almost half of a year now. It's a shame it can't be reverted back to a previous, working version.

@sethbro
Copy link

sethbro commented Aug 1, 2012

Using Rails 3 and Premailer through https://github.com/fphilipe/premailer-rails3, I encountered this problem & was able to solve by explicitly setting the encoding to UTF-8.

# config/initializers/premailer.rb

PremailerRails.config.merge!(input_encoding: 'UTF-8')

@geetarista
Copy link

@sethbro Isn't that the default?

@sethbro
Copy link

sethbro commented Aug 2, 2012

For premailer-rails3, yes. I failed to control for something & this isn't the fix I thought.

For Premailer itself, ASCII-8BIT is the default input encoding (https://github.com/alexdunae/premailer/blob/master/lib/premailer/premailer.rb#L211), so that's probably worth setting in your own app.

@geetarista
Copy link

Aha! Thanks @sethbro.

@akzhan
Copy link
Member

akzhan commented Oct 23, 2013

Duplicates #30.

@akzhan akzhan closed this as completed Oct 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests