setEncodeUTF8

setEncodeUTF8

TRIAL / ADVANCED / PREMIUM

Enforces UTF-8 encoding of the Word document contents.

Description
public setEncodeUTF8 ()

This method enforces the UTF-8 encoding of all contents.

If the contents are already UTF-8 encoded this method may cause double encoding.

You may set up the option encode_to_UTF8 to true in the config/phpdocxconfig.ini file. If so, phpdocx checks if the contents are already UTF-8 encoded to avoid double encoding. Anyhow, it is strongly recommended to use UTF-8 compatible editors and prepare all data coming from external sources so it is UTF-8 encoded.

Release notes
  • phpdocx 14.0:
    • use mb_convert_encoding with PHP 8.2 and newer PHP versions.