Project

General

Profile

Actions

Bug #29067

closed

Encoding UTF-8 in unescape function

Added by Rafał Wójcik almost 13 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2011-08-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

The best way to understand bug is look for video:
http://www.screencast-o-matic.com/watch/cXjbju3fU [^]

I solve problem in my typo3 version but I think that not only I have this problem.

SOLVE:
- file: t3lib/class.t3lib_tceforms.php:
line: 2799

change:

$onClickInsert .= 'new Insertion.Bottom($("' . $idTagPrefix . '"), unescape("' . rawurlencode($newElementTemplate) . '").' . $replace . '); setActionStatus("' . $idTagPrefix . '");';

to:

$onClickInsert .= 'new Insertion.Bottom($("' . $idTagPrefix . '"), utf8_decode(unescape("' . rawurlencode($newElementTemplate) . '")).' . $replace . '); setActionStatus("' . $idTagPrefix . '");';

and add somwhere JS function:

function utf8_decode (utftext) {
    var string = ""; var i = 0; var c = c1 = c2 = 0;
    while ( i < utftext.length ) {
        c = utftext.charCodeAt(i);
        if (c < 128) { string += String.fromCharCode(c); i++; }
        else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; }
        else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; }
    }
    return string;
}

Sorry form my poor english :)


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #32422: Encoding error in TCEforms inline JavaScriptClosedSteffen Gebert2011-12-09

Actions
Related to TYPO3 Core - Bug #34330: Encoding error in flexform sections if backend is not UTF-8Closed2012-02-27

Actions
Has duplicate TYPO3 Core - Bug #28952: Flexform shows utf8-labels and options not correctlyClosed2011-08-12

Actions
Actions #1

Updated by Chris topher over 12 years ago

  • Target version changed from 4.5.6 to 4.5.8
Actions #2

Updated by Markus Klein over 12 years ago

Patch pushed in #28952.

Actions #3

Updated by Xavier Perseguers over 12 years ago

  • Status changed from New to Under Review
Actions #4

Updated by Xavier Perseguers over 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Steffen Gebert over 12 years ago

Please have a look at #32422, as this change seems to have introduced a new bug!

Actions #6

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF