Welcome, Guest
Username: Password: Remember me

TOPIC: Problems with charset

Problems with charset 3 years 6 months ago #60151

  • steven8000
  • steven8000's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 16
  • Karma: 0
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:

1.jpg


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.

2.jpg


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
The administrator has disabled public write access.

Re: Problems with charset 3 years 6 months ago #60196

  • steven8000
  • steven8000's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 16
  • Karma: 0
anyone an idea?
The administrator has disabled public write access.

Re: Problems with charset 3 years 6 months ago #60261

  • steven8000
  • steven8000's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 16
  • Karma: 0
Can someone help me please?

Extra info. The survey is uploaded with a csv.
The administrator has disabled public write access.

Re: Problems with charset 3 years 6 months ago #60510

  • jquinter
  • jquinter's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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 {
...
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.115 seconds
Donation Image