Bug #16566
closedexternal UTF-8 files parsed with INCLUDE_TYPOSCRIPT are not correctly handled
0%
Description
I wanted to store the translations of my templavoila templates' text items into external files, then load the translations from those external files using the INCLUDE_TYPOSCRIPT directive into my template's CONSTANTS section :
// Arabic language
[globalVar = GP:L = 3]
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/templates/deria-audio/translations/home_ar.txt">
[GLOBAL]
then in the SETUP section of the template, the siteMenuLabel value is inserted as defined in the text file :
lib.siteMenuLabel.value={$siteMenuLabel}
The value being defined inside the external text file as (utf-8 characters may not render correctly on the bugs.typo3.org page. The right value of this declaration is made of arabic characters):
siteMenuLabel_ar= (arabic signs here, see attached TXT file)
Unfortunately, the rendered template whould output the following garbage using the INCLUDE_TYPOSCRIPT method :
siteMenuLabel_ar}$}
If you define
siteMenuLabel= (arabic signs here, see attached TXT file)
straight in the CONSTANTS section of the template (thus no import from INCLUDE_TYPOSCRIPT) the arabic characters display correctly.
Of course I have tried with various UTF-8 compliant editors to edit the text file and none fixed the issue. While the arabic characters display correctly in the editor (even after a save/restart/load of the file). Thus I assume the parsing function of the INCLUDE_TYPOSCRIPT function perverts UTF-8 characters and doesn't pass them correctly to typoscript.
I have attached the test external file with arabic characters (generated with dreamweaver).
(issue imported from #M4221)
Files