# Creation of i18n PDF files (from UTF-8 encoded strings)

**URL:** <https://www.ruby-forum.com/t/creation-of-i18n-pdf-files-from-utf-8-encoded-strings/53214>\
**Category:** Ruby\
**Created:** [January 29, 2006, 9:33am UTC](https://www.ruby-forum.com/t/creation-of-i18n-pdf-files-from-utf-8-encoded-strings/53214 "2006-01-29T09:33:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kajism](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f475e1/32.png) [@kajism](https://www.ruby-forum.com/u/kajism)\
**Post date:** [January 29, 2006, 9:33am UTC](https://www.ruby-forum.com/t/creation-of-i18n-pdf-files-from-utf-8-encoded-strings/53214/1 "2006-01-29T09:33:38Z")

</div>

Hi,

I have been playing with PDF::Writer for a while, but wasn’t able to  
force it to display international characters correctly. I have succeed  
to display the right characters using select\_font diferencies hash, but  
this results to invalid character widths which produced overlapped  
texts. I have tried to edit the provided .asf files without any  
effect/success.

Any help will be welcome.

Thanks in advance,  
Karel

---

<div class="post-metadata">

**Author:** ![kajism](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f475e1/32.png) [@kajism](https://www.ruby-forum.com/u/kajism)\
**Post date:** [January 29, 2006, 7:19pm UTC](https://www.ruby-forum.com/t/creation-of-i18n-pdf-files-from-utf-8-encoded-strings/53214/2 "2006-01-29T19:19:46Z")

</div>

On 29/01/06, Karel M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have been playing with PDF::Writer for a while, but wasn’t able to  
> force it to display international characters correctly. I have succeed  
> to display the right characters using select\_font diferencies hash, but  
> this results to invalid character widths which produced overlapped  
> texts. I have tried to edit the provided .asf files without any  
> effect/success.

PDF::Writer only supports limited I18N at this point; it will never  
support UTF-8 (the underlying specification does not support UTF-8).

When Unicode support is added, it will be using UTF-16.

-austin

---

<div class="post-metadata">

**Author:** ![kajism](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f475e1/32.png) [@kajism](https://www.ruby-forum.com/u/kajism)\
**Post date:** [January 30, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/creation-of-i18n-pdf-files-from-utf-8-encoded-strings/53214/3 "2006-01-30T17:02:36Z")

</div>

Austin, thanks for your response.

So is there a chance how to affect the character with by editing the  
.asf file?  
I mean, I define the in the differences array that 200 will be for  
example “Cacute”, but this character is wider than the original one with  
ascii code 200.

I have tried editing Helvetica.asf file but without success. It seems  
that the PDF::Writer code reading the character widths from .asf is  
never executed (due to the conditions).

Any advice concerning this?

Thanks in advance,  
Karel
