Check out the LimeSurvey source code on GitHub!

Problems with charset

More
5 years 9 months ago #60151 by steven8000
Version 1.90+
Windows 2003 server SP1
SQL 2005
Collation database: Latin1_General_CI_AS

Hey,

I have problems with the charset in some languages. After installing een upgrade from version 1.87 to 1.90, i have still the same problems.

I use an own created template, but with the standard templates i have it also.

When i view a test in IE of FF, i get this:



As you can see, the charset of the page is UTF-8.
When I place the charset within to "Western (iso-8859-1) the body is placed correctly but the language dropdown not.



After some search on the internet, i found out that the charset for Czech, not UTF-8 or iso-8859-1 is but iso-8859-2.
The language vile cs.po is configured for UTF-8.
I changed it to iso-8859-2 but this was not a sollution. (And i can't change it to iso-8859-1)

The template is set to utf-8, but the standard templates also.

Do you have any idea how i can resolve this?
Can it be something with the sql db?

With regards,

Steven
Attachments:

Please Log in to join the conversation.

More
5 years 9 months ago #60196 by steven8000
anyone an idea?

Please Log in to join the conversation.

More
5 years 9 months ago #60261 by steven8000
Can someone help me please?

Extra info. The survey is uploaded with a csv.

Please Log in to join the conversation.

More
5 years 9 months ago #60510 by jquinter
Hello. Recently I've faced the same problem. What I managed to fix it, was to modify the file language.php, such that every time a label was loaded in order to generate the page, the label was parsed looking for chars in non-standard sets.

Modify: classes/core/language.php
Locate: the function gT, in particular, a good place is after this line

$basestring=str_replace('‘','\'',$this->gettextclass->translate($string));

ADD:

$basestring = utf8_decode($basestring);


If you need more detail:

BEFORE

function gT($string, $escapemode = 'html')
{
if ($this->gettextclass)
{
$basestring=str_replace('‘','\'',$this->gettextclass->translate($string));
switch ($escapemode)
{
case 'html':
return html_escape($basestring);
break;
case 'js':
return javascript_escape($basestring);
break;
case 'unescaped':
return $basestring;
break;
default:
return "Unsupported EscapeMode in gT method";
break;
}
} else {
...


AFTER

function gT($string, $escapemode = 'html')
{
if ($this->gettextclass)
{
$basestring=str_replace('‘','\'',$this->gettextclass->translate($string));
$basestring = utf8_decode($basestring);
switch ($escapemode)
{
case 'html':
return html_escape($basestring);
break;
case 'js':
return javascript_escape($basestring);
break;
case 'unescaped':
return $basestring;
break;
default:
return "Unsupported EscapeMode in gT method";
break;
}
} else {
...

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form