Charset/Encoding problems using Gallery

Discuss the development and implementation of Joomla! modules here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Jaxe
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Aug 27, 2005 1:17 pm
Contact:

Charset/Encoding problems using Gallery

Post by Jaxe » Thu Sep 08, 2005 6:09 pm

Hi guys,

after aprox. 2 week of debuggin, I've found the source of my charset problem. I'm using danish letters "æ,"ø","å" which is supported by the iso-8859-1 charset.See the change in the "Latest Event module - buttom left.

My frontpage ( using ver 4.5.2.3 )  http://www.whacked.dk looks fine, but as soon as is enter the embedded Gallery (Menalto ver. 2-rc2 ) it changes charset to UTF-8. The result is charset problems on the rest of the site ( but not i Gallery! ).

Its really stange. Im using the com_gallery2_v2.0.6.1 to embed the Gallery. The same problem occours when the mod_gallery_block-v2.3 and mod_galleryside_v2.3.

Looking deeper into the components, they use alle make use of global $iso_client_lang,$mosConfig_locale and i suspekt the problem lies in userfuncs.php:

Code: Select all

/*
 *language function
 * $iso_client_lang = mabelfish iso valua, may be empty
 * $mosConfig_locale = default mambo language
 */
function switchlang($iso_client_lang, $mosConfig_locale){
	if(!empty($iso_client_lang)){
		$lang = strtolower($iso_client_lang);
		$lang = G2helperclass::landtolang($lang);
	} else {
		$lang = substr ($mosConfig_locale, 0, 2); //pick first 2	
	}
	return trim($lang);
}

/*
 * function for replacing land iso code with language iso code used by switchlang function
 * possible update to use string(5) iso code
 */
function landtolang($lang){
	//make a list of lands the have a not corresponding iso codes
	$array = array();
	$array['gb'] = 'en';
	$array['us'] = 'en';
	$array['gr'] = 'el';
	$array['mx'] = 'es';
	$array['AR'] = 'es';
	$array['br'] = 'pt';
	$array['cn'] = 'zh';
	$array['tw'] = 'zh';
	$array['jp'] = 'ja';
	$array['ie'] = 'ga';
	$array['se'] = 'sv';
	$array['il'] = 'he';
	$array['dk'] = 'da';
	$array['yu'] = 'sr';
	$array['si'] = 'sl';
	$array['cz'] = 'cs';
	$array['vn'] = 'vi';
	//lets match
	foreach($array as $land_iso => $lang_iso){
		if(strpos($lang, $land_iso) === 0 AND $gotit != 1){
			$lang = $lang_iso;
			$gotit = 1;
		}
	}
	return $lang;
}
My site runs with PHP option REGISTER_GLOBALS = OFF, but the same problems occours with "ON".

Anyone else having the same problems. Any comments and suggestions are more than welcome.

Yours Jaxe

Jaxe
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Aug 27, 2005 1:17 pm
Contact:

Re: Charset/Encoding problems using Gallery

Post by Jaxe » Fri Sep 09, 2005 1:36 pm

It seems that Gallery uses UTF-8 encoding all he way through.

Is there an easy way of getting Mambo to use UFT-8 as default on all pages and modules?

User avatar
ccondrup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 219
Joined: Tue Aug 23, 2005 9:54 am
Location: Oslo

Re: Charset/Encoding problems using Gallery

Post by ccondrup » Wed Sep 14, 2005 1:30 pm

I would also like to know how to change the charset in Mambo, having this same problem.
Did you know there's a Joomla irc channel? Chat to Joomla people live 24/7 - Join #joomla on the Freenode network ( irc.freenode.net )

User avatar
Outoman
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Mon Aug 22, 2005 3:58 pm
Location: Southern Dalarna
Contact:

Re: Charset/Encoding problems using Gallery

Post by Outoman » Tue Sep 20, 2005 10:36 am

Jaxe, how did you  solve your problem? I´ve seen on your website that you fixed your problem. I have the same problem you had.

User avatar
ccondrup
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 219
Joined: Tue Aug 23, 2005 9:54 am
Location: Oslo

Re: Charset/Encoding problems using Gallery

Post by ccondrup » Tue Sep 20, 2005 2:00 pm

--> This thread explains a lot <--

Change the line in your language file (ie: joomla/language/french.php) that starts with:
DEFINE('_ISO'

specify what charset to use (most want to set UTF-8 I think), like this:
DEFINE('_ISO','charset=utf-8');

You have now set mambo to use this charset. Other modules and components who have their own config files, MIGHT use something else, and if so you have to make this change for those modules as well.

For a litte more understanding of what's happening, take a look at the database with phpmyadmin before and after the change - see how the international characters are stored.

Yeah, by the way: The gallery component+modules on that site works like a charm, recommended! (I'm running 2.0.8)
Last edited by ccondrup on Tue Sep 20, 2005 2:02 pm, edited 1 time in total.
Did you know there's a Joomla irc channel? Chat to Joomla people live 24/7 - Join #joomla on the Freenode network ( irc.freenode.net )

matyrojo666
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Tue Jan 02, 2007 1:16 pm

Re: Charset/Encoding problems using Gallery

Post by matyrojo666 » Sun Apr 29, 2007 1:57 pm

ccondrup wrote: --> This thread explains a lot <--

Change the line in your language file (ie: joomla/language/french.php) that starts with:
DEFINE('_ISO'

specify what charset to use (most want to set UTF-8 I think), like this:
DEFINE('_ISO','charset=utf-8');

You have now set mambo to use this charset. Other modules and components who have their own config files, MIGHT use something else, and if so you have to make this change for those modules as well.

For a litte more understanding of what's happening, take a look at the database with phpmyadmin before and after the change - see how the international characters are stored.

Yeah, by the way: The gallery component+modules on that site works like a charm, recommended! (I'm running 2.0.8)
I have the same problem. I did what you said, my RSS module were fixed, but all other modules are wrong now !!
Here´s my problem

http://forum.joomla.org/index.php/topic,165013.0.html

If I change something then is wrong to the hole site

Any comment?

matyrojo666
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Tue Jan 02, 2007 1:16 pm

Re: Charset/Encoding problems using Gallery

Post by matyrojo666 » Sun Apr 29, 2007 2:01 pm

ccondrup wrote: --> This thread explains a lot <--

Change the line in your language file (ie: joomla/language/french.php) that starts with:
DEFINE('_ISO'

specify what charset to use (most want to set UTF-8 I think), like this:
DEFINE('_ISO','charset=utf-8');

You have now set mambo to use this charset. Other modules and components who have their own config files, MIGHT use something else, and if so you have to make this change for those modules as well.

For a litte more understanding of what's happening, take a look at the database with phpmyadmin before and after the change - see how the international characters are stored.

Yeah, by the way: The gallery component+modules on that site works like a charm, recommended! (I'm running 2.0.8)
I can´t beleive it!! If I fix my problem (RSS Module)...the entire site is wrong and the rss module is ok !!! I´m crazy  :-[


Locked

Return to “Modules”