문제

I'm using OpenTBS to modify word templates from PHP. Basically I need to update strings in a word document from values that I have in a MySQL database. It is working well, however when I have special characters such as é, à, ô, it outputs a sequence of weird caracters.

For example the é gives me é.

Anybody knows how to fix that?

Thanks

도움이 되었습니까?

해결책

By default, OpenTBS assumes that the data to be merged are Ascii encoded. It the data is UTF-8 encoded, then you have to specify it when loading the template.

Example:

$TBS->LoadTemplate('document.docx', OPENTBS_ALREADY_UTF8);

You also have to check that your PHP script is UTF-8 encoded.

More details are given in the manual.

다른 팁

Its a character encoding issue. Change your page to utf-8

See http://php.net/manual/en/function.header.php
Content-Type: text/plain; charset=utf-8
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top