From 6278d2a58d1f163a9fd664a7b89098f09851d054 Mon Sep 17 00:00:00 2001 From: Andrew Kovalyov Date: Sat, 14 Nov 2015 00:04:23 +0200 Subject: [PATCH] Add a note about locales --- doc/faq.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/faq.md b/doc/faq.md index 0794cb9b..ccd4a15b 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -62,3 +62,16 @@ table, tr, td, th, tbody, thead, tfoot { ###### *Q*: My chars with accents in HTML document are not correctly rendered. *A*: Make sure that you have set `` + +###### *Q*: My chars with accents passed to wkhtmltopdf options are not correctly rendered, i.e. `footer-right => 'Página [page] de [toPage]'` is converted to 'Página 1 de 1'. + +*A*: The answer is long here. We use `escapeshellarg` (and Symfony/Process as well) function to escape all the option value passed to `wkhtmltox`. `escapeshellarg` makes its escape based on server locale, so if you are experiencing this issue - you can set +```php +setlocale(LC_CTYPE, 'es_ES.UTF-8') +``` + +or any locale which is suitable for you. You should take into account that if given locale is not configured on the server - you will still have an issue. Check your locales installed via running +```bash +locale -a +``` +If the needed locale is missing on the server - you should install/configure it.