Project

General

Profile

Actions

Bug #19193

closed

Charset problems if caching is not enabled (config.no_cache = 1)

Added by Andreas Dörler over 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-08-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Typo3 4.2.1
PHP 5.2.0-8+etch10
MySQL 5.0.32

DB, Typo3-FE & -BE is using utf-8. typo3conf

$TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';

mysql> show variables where variable_name like '%char%';
----------------------------------------------------+ | Variable_name | Value |
----------------------------------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ |
----------------------------------------------------+

Insert a HTML-Element on any page with content "»" is working without problems, as long as "config.no_cache = 1" is set.

After enabling caching "»" results in an unknown symbol (=> ?) and the html-source stored in the field "HTML" in table "cache_pages" is cut off after this point. On next reload the cached (but destroyed) source is delivered to the browser.

If I insert the Symbol by copy&paste from a Website like http://unicode.e-workers.de/entities.php everything works OK. But this is no solution, as for example newscalendar uses "»" and "«" for navigation etc...

I could not reproduce this error on another typo3-installation at the same server, but cannot see any significant difference between the installations.

The field "HTML" in "cache_pages" is "mediumtext", could this issue be related to something like this:

2007-04-02 Michael Stucki <>
  • Fixed bug #17053: Cache is not saved properly because of charset conflict in the database. Changing the field type of cache_hash.content from mediumtext to mediumblob. To make this work, you need to compare your database in the Install Tool.

=> After changing fieldtype to mediumblob, the whole source is saved into "HTML", but "»" is still an unknown symbol in the FE.
(issue imported from #M9120)

Actions #1

Updated by Andreas Dörler over 16 years ago

Sorry, the html-entities have been replaced after submitting the bug report.

Insert a HTML-Element on any page with content "»" is working without problems, as long as "config.no_cache = 1" is set.

should be:

Insert a HTML-Element on any page with content "&raquo;" is working without problems, as long as "config.no_cache = 1" is set.

AND

If I insert the Symbol by copy&paste from a Website like http://unicode.e-workers.de/entities.php [^] everything works OK. But this is no solution, as for example newscalendar uses "»" and "«" for navigation etc...

should be

If I insert the Symbol by copy&paste from a Website like http://unicode.e-workers.de/entities.php [^] everything works OK. But this is no solution, as for example newscalendar uses "&raqou;" and "&laquo;" for navigation etc...

Actions #2

Updated by Christian Brunner over 16 years ago

i'm not sure, but i think i had a similar problem. i my case umlauts (ä,ö,ü) were destroyed.

try to set
$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8'.chr(10).'SET CHARACTER SET utf8';

i my case that solved the problem

Actions #3

Updated by Andreas Dörler over 16 years ago

Hi Christian,

I've already tried
$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8'.chr(10).'SET CHARACTER SET utf8';
without success.
I got that hint from here:
http://www.typo3forum.net/forum/typo3-4-x-fragen-probleme/22719-probleme-zeichenkodierung-caching.html

I did not have any problems with german umlauts on this installation yet.

Actions #4

Updated by Andreas Dörler over 16 years ago

Category of this report should be: [- TYPO3 Core -]

Actions #5

Updated by Markus Bischof over 16 years ago

Same here. I have a fresh installation with 4.2.1. Error occured at &nbsp; in the HTML Source

Actions #6

Updated by Andreas Dörler over 16 years ago

I think I've found the reason in tidy.
After disabling Tidy again with $TYPO3_CONF_VARS['FE']['tidy'] = '0'; all is working as expected!

Tidy does (in the default case) only "beautify" the content before it goes to cache, that's why nothing happend if cache is disabled.

@Markus: Could you please check if tidy is enabled in your installation!

Actions #7

Updated by Markus Bischof over 16 years ago

I can confirm that. After disabling tidy in the install tool everything worked fine again!

Actions #8

Updated by Christian Brunner over 16 years ago

hey dmitry, i think you corrected the title the wrong way. he has problems when caching is enabled!

so the title should be only "Charset problems if caching is enabled" i think

greez

Actions #9

Updated by Christian Kuhn over 14 years ago

Resolved, no change required. Afaik tidy needs some hinting to handle charsets properly.

Actions #10

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF