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

Encoding issues #35

Closed
empz opened this issue Apr 20, 2011 · 8 comments
Closed

Encoding issues #35

empz opened this issue Apr 20, 2011 · 8 comments

Comments

@empz
Copy link

empz commented Apr 20, 2011

Hi,

I've been able to generate PDF documents under Ubuntu and Rails 3.

The problem I'm facing is with latin characters like (á, é, í, ó, ú). They are not being rendered well in the PDF document. Instaed i'm getting the following.

ó => Ã3
é => é

I've tried adding :encoding => "utf8" but nothing happened.

Any workaround?

@unixmonkey
Copy link
Collaborator

Can you try putting this line:

  # encoding: utf-8

as the first line of your controller (possibly the Model as well) that is rendering the PDF?

here's an example repository of a project that does just that (and has some special chars on the pdf)
https://github.com/DevL/shownotes/tree/master/SHRUG_2011-04-13_PDF/wicked

I think that's all you should need to do. Please report back and let me know how that went.

@PapePathe
Copy link

i had the same issue, putting encoding: utf-8 didn't solve the problem

@unixmonkey
Copy link
Collaborator

Are you using the latest version of this plugin from Github? I only recently made the streams work in binary mode in this commit:
788ad4e

@LaurentSHB
Copy link

I had the same issue.

To solve it, i add at the beggining of my view this line :

Now it works fine and I add nothing in my controller (no #encoding: utf-8 or :encoding => "utf8")

@unixmonkey
Copy link
Collaborator

@LuckyNumberSlevin: Awesome! That's exactly the type of thing that keeps me up at night. I think I'll throw something about that in the README.

@PapePathe
Copy link

Got it! thanks a lot guys. I'm using the lib in a project in a project & it works well, maybe i'll switch to the gem to simplify management with bundler.

@michaelschapira
Copy link

Thanks luckynumberslevin ! Makes the job.

@unixmonkey
Copy link
Collaborator

I've added a note to the README in this commit:
9684b09

Thanks for all your participation!

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

5 participants