Kjapp og trygg hosting for Wordpress

Retrieve Special Norwegian Character from database...

Marlyn

New Member
how it works:
1. write to pdf from mysql database
2. attach the pdf file then send to recipients


additional info settings:
msql collation: utf8_unicode_ci

for pdf email:
$doc2->setCharset('ISO-8859-1');
$doc2->setEmailCharset('ISO-8859-1');

so far this works properly when sent to recipients except for the Norwegian characters which displays in funny way.
for example: Æ turns out to be Æ. same as the other. i want and the client wants the information to display as is to the pdf. the database will save Æ as Æ so far , but when retrieved from database and write it to pdf file, it turns out different. what should i do to make it display properly?

hope you guys answer back in english. thanks in advance.
 
Sist redigert:

Pong

Jeg selger sʇɥƃıluʍop :)
I'd say you need to convert the string you got from the mysql database from utf8 into iso before sending it to the pdf object.

"The database will save Æ as Æ so far" <- how can you tell? Your client that talks to the database probably has some logic that will display the UTF-8 info correctly, so Æ as Æ...

I think.
 

TorsteinO

Art Director & grunder
I am pretty sure Æ for Æ is what you get if your database is setup as latin_1 or something like that, while you input things as UTF-8, and then try to change either.

Had some similar trouble when I switched servers on my blog, where the old DB was latin1, the new was utf-8, and both the new and the old wp-config was setup with UTF-8. The workaround was as simple as switching around in WP-config - not really perfect, but it works.
 

Marlyn

New Member
had it working. pdf header should be set to utf-8, not ISO.
but the funny thing is the spacing of character are not consistent. there is a random space in between the words. - in the pdf

but in the contents of mail, i get ?? in replacement of Æ and other special characters... MIME?
 
Topp