Hello Modx’ers,
I have a weird problem, I hope you can help me.
I need to have the banckend in spanish, so I chose under Configuration=> Site:
Language: Spanish
Character Encoding: Latin 9 (ISO) - iso-8859-15
Everything looks fine, and I can see all Spanish characters with no problems, but when I try to Save any page, or save any configurations or documents, I ALWAYS get the following warning:
Warning: Cannot modify header information - headers already sent by (output started at /home/cpfoster/public_html/manager/includes/lang/spanish.inc.php:15) in /home/cpfoster/public_html/manager/processors/save_settings.processor.php on line 49
This never happens when Language: English and Character Encoding: Unicode(UTF-8)-utf-8 are selected.
For your information, the charset and collation for my database are:
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_general_ci
NOTE: I tested the spanish backend on both Linux and Windows servers and the problem happens in Linux servers ONLY.
Any clues please?
Thanks.
Mc
-
MODX Staff
- 10,725 Posts
I always recommend running the database with utf-8; all you need to do is convert the spanish language file into utf-8.
Open up the file located at [tt]manager/includes/lang/spanish.inc.php[/tt] in a text editor, scroll all the way to the bottom, and remove all the whitespace after the closing [tt]?>[/tt] tag.
-
MODX Staff
- 10,725 Posts
Indeed, this is a common problem with files that contain only PHP code; any trailing whitespace will be sent as output. This can turn up as phantom whitespace on your pages, that sometimes creates havoc and is hard to track down.
Something I often do in files like this is to remove the closing PHP tag from PHP files that only contain PHP. The closing tag is not required by PHP, and by not including it, I avoid the whitespace problem altogether. This would be the ultimate solution if only all PHP editors could properly highlight code without the closing tag.