resolved: Mariadb 10 and unicode

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

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
User avatar
magj
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Tue Apr 18, 2006 1:14 pm

resolved: Mariadb 10 and unicode

Post by magj » Fri Jul 17, 2015 11:05 am

Hi
I have a cpanel server which I tried to upgrade the mysql to mariadb 10, now everything works except many joomla 1.5 websites which were using unicode languages are now displaying question mark instead of every character:

??????????????? ?????????

I took a look, the data is ok on databases (via phpmyadmin) and when I move to another server with mariadb 5.6 it's ok.

In the system information there is:
Unfortunately It is too urgent so I'm asking this in every forum possible ;)

Code: Select all

Database Version: 	10.0.20-MariaDB
Database Collation: 	N/A (mySQL < 4.1.2)
PHP Version: 	5.3.29
Web Server: 	Apache
Web Server to PHP interface: 	cgi-fcgi
Joomla! Version: 	Joomla! 1.5.26 Stable [ senu takaa ama busani ] 27-March-2012 18:00 GMT
User Agent: 	Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0 
does it something like modifying these lines and specifing utf8?

Code: Select all

libraries/joomla/database/database/mysql.php

Code: Select all

public function getCollation ()
{
        if ($this->hasUTF()) {
                $this->setQuery('SHOW FULL COLUMNS FROM #__content');
                $array = $this->loadAssocList();
                return $array['4']['Collation'];
        } else {
                return "N/A (mySQL < 4.1.2)";
        }
}
As I asked this from Mariadb , they said:
At a guess, based on the Joomla output you posted, this is a problem in the Joomla 1.5 code, where it is not recognizing MariaDB 10.x as a valid version, and is instead reverting to using some sort of pre-mySQL < 4.1.2 collation.

This is probably a simple fix in the Joomla code if that's an option, .......

Any help would be greatly appreciated.
Last edited by magj on Fri Jul 17, 2015 11:23 am, edited 1 time in total.
طراحی سایت و بهینه سازی سایت:

http://sefid.net


 
User avatar
magj
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Tue Apr 18, 2006 1:14 pm

Re: Mariadb 10 and unicode

Post by magj » Fri Jul 17, 2015 11:23 am

For anyone who may ever stuck with this issue ,you can run a quick fix:

hope it helps

in

Code: Select all

libraries/joomla/database/database/mysql.php
or (depending on your setting)

Code: Select all

libraries/joomla/database/database/mysqli.php
comment the line 186

Code: Select all

return ($verParts[0] == 5 || ($verParts[0] == 4 && $verParts[1] == 1 && (int)$verParts[2] >= 2));
and add this instead(assuming these days you'll have unicode supported database:

Code: Select all

	return (1);
the code looks like:

Code: Select all

function hasUTF()
	{
		$verParts = explode( '.', $this->getVersion() );
	//	return ($verParts[0] == 5 || ($verParts[0] == 4 && $verParts[1] == 1 && (int)$verParts[2] >= 2));
	return (1);
	}
Best
طراحی سایت و بهینه سازی سایت:

http://sefid.net


korent
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Jul 31, 2015 3:55 pm

Re: resolved: Mariadb 10 and unicode

Post by korent » Wed Aug 26, 2015 11:19 am

Hi and thank you for bothering to reply back on your own post with a solution!

I had the exact same issue and just like yours it needed an urgent fix.
I thank you for your good thinking as it fixed the issue!

User avatar
Chacapamac
Joomla! Guru
Joomla! Guru
Posts: 947
Joined: Wed Feb 20, 2008 6:50 am
Location: Canada, Montreal
Contact:

Re: resolved: Mariadb 10 and unicode

Post by Chacapamac » Sat Oct 03, 2015 2:50 am

Thanks A million time for this fix — Joomla community is the best
Can God help us?
Marketing, SEO, Web development - Powered by Joomla!
http://www.grafcomm.ca/

heretic
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Tue Jul 24, 2007 10:02 am
Location: Czech Republic

Re: resolved: Mariadb 10 and unicode

Post by heretic » Fri Aug 12, 2016 10:59 am

Great work, magj - I just had to deal with the same issue. Thanks a lot :-).

 

Locked

Return to “Administration 1.5”