Forums / General Questions / Problem with size and maxlength after converting database to UTF8

Problem with size and maxlength after converting database to UTF8

Locked

Started by ronson on 4 Sep 2007, 10:17 AM · Views: 1,788

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
4 Sep 2007, 10:17 AM
#1
ronson avatar

ronson

New Zenner

Join Date:
Oct 2006
Posts:
20
Plugin Contributions:
0

Problem with size and maxlength after converting database to UTF8

In order for the second language (bulgarian) to work correctly, I did the following changes in the my Zen Cart as described here: http://www.zen-cart.com/forum/showpost.php?p=426459&postcount=5

I converted my db to UTF8, as well as all collation of the tables and the fields from latin1 to utf8_general_ci with PhpMyAdmin

Then I noticed that in the login/register page all the form fields have tripled their sizes and maxlengths, e.g. from 32 to 96. As I understand Zen cart asks the database for these values, but I could not find where they are stored in the db.

My server info:
Server OS: Linux 2.6.21.3-grsec
Database: MySQL 5.0.41-log
Server Date: 09/04/2007 13:12:38
Database Date: 09/04/2007 13:12:38
PHP Version: 4.4.7 (Zend: 1.3.0)
HTTP Server: Apache

I read the other threads about the maxlength=0 or =1 but I think that is not the case with me because I have a test Zen Cart shop running on the same server with latin1 collation database and it does not have this problem.

URL to see the problem: https://www.diemfishing.com/catalog/index.php?main_page=login

4 Sep 2007, 11:25 AM
#2
ronson avatar

ronson

New Zenner

Join Date:
Oct 2006
Posts:
20
Plugin Contributions:
0

Re: Problem with size and maxlength after converting database to UTF8

Now I noticed that the the problem is not only with the login/register page but with all text fields in the catalog and the admin. Please help.

4 Sep 2007, 11:50 AM
#3
ronson avatar

ronson

New Zenner

Join Date:
Oct 2006
Posts:
20
Plugin Contributions:
0

Re: Problem with size and maxlength after converting database to UTF8

Ok, after a little investigation I found that when I restore /includes/classes/db/mysql/query_factory.php to the original the problem disappears.

My query_factory.php is modified as described here: http://www.zen-cart.com/forum/showpost.php?p=426459&postcount=5

4 Sep 2007, 12:06 PM
#4
ronson avatar

ronson

New Zenner

Join Date:
Oct 2006
Posts:
20
Plugin Contributions:
0

Re: Problem with size and maxlength after converting database to UTF8

After a little bit more investigation I found that zen_field_length function does not return correct values. Probably it is related to the database, particularly with the utf8 collation. Any suggestions how to resolve this problem?

For now I set $length = $length/3