1
LazyBadger
Help wanted - 8bit text and MySQL 4.1

Want to get advice, guide or How-To on topic's problem.
According to http://dev.mysql.com/doc/mysql/en/charset.html and http://dev.mysql.com/doc/mysql/en/charset-connection.html) clent must execute one additional command before any data fetch from MySQL in order to get reabable text

How to do it in current XOOPS?! This is HOT problem for almost all non US-ASCII alphabets

2
LazyBadger
Re: Help wanted - 8bit text and MySQL 4.1

Sorry... bump!

3
LazyBadger
re. 8bit text and MySQL 4.1

Nobody interested in... Well, ok!
I'll solve this problem and wrote to all: "XOOPS is not ready for MySQL 4.1 and will not be ready this this style of problem-solving"

4
Mithrandir
Re: 8bit text and MySQL 4.1

Could you please not use profanity in the topic titles and maybe explain the problem in a bit more detail?

I'm reading through the MySQL documentation, but since I don't normally have problems with this (as I mainly use Danish or English) it would be helpful with a better description of the problem and what could be causing it.

5
victorgfu
Re: 8bit text and MySQL 4.1
  • 2005/7/11 19:52

  • victorgfu

  • Just popping in

  • Posts: 10

  • Since: 2005/4/18


The problem is that starting from mySQL 4.1 the default charsetting in the DB is used as UTF-8. Thus, migrating from mySQL 3.22 and having all my DB dump in cp1251 encoding that is cyrillic encoding, I have to put in the files mysqldatabase.php and databasefactory.php the following things
Quote:
mysql_query('SET character_set_results="cp1251"');
mysql_query("SET CHARACTER SET cp1251");
mysql_query("SET NAMES 'cp1251'");

in order to force the MySQL to write and read the data as cp1251 but not as utf-8. This is crucial for Russian and other non 7bit encodings. Thus, upholding LazyBladger's request and upsetting with the supject, I do pledge the XOOPS developer's comamnd to make right support for using non unicode 8bit encodings, for the mySQL DB's with versions higher 3.22, i.e. 4.1 and higher.

6
Mithrandir
Re: 8bit text and MySQL 4.1

OK, I see the problem. When should those queries be sent? After opening the connection?
I guess it would not be difficult to add to the MySQLDatabase constructor (Is it really necessary in XoopsDatabaseFactory? Having MySQL-specific queries there seems to make it more difficult for us to create new classes for PostGreSQL or others)

However, this is only for MySQL 4.1 and higher? Do you know how to see the database version without knowing the encoding? I mean, we need to know the database version before we start querying, and we shouldn't set the character set on sub-4.1 versions.
Or perhaps we should have a new class? One for MySQL 4.0.x or lower and one for MySQL 4.1 or higher?

When we get the approach right, I'll do my best to see to it that we get the right solution, too.

Thank you for your help in explaining the problem and finding the solution, Victor.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

7
victorgfu
Re: 8bit text and MySQL 4.1
  • 2005/7/11 20:34

  • victorgfu

  • Just popping in

  • Posts: 10

  • Since: 2005/4/18


Yes, the "problem" is with the 4.1 version and higher. You are right that we should know the version of the DB because if the queries are sent to 3.22 there will be an error, because this version doesnt understand these commands.
So, I AM GLAD THAT YOU UNDTERSTOOD the problem and keep it in mind to bring it to reality, to have the problem with the encodings for current mySQL DB versions fixed in XOOPS.

Login

Username:
Password:

Lost Password? Register now!

Who's Online

66 user(s) are online (30 user(s) are browsing Support Forums)


Members: 0


Guests: 66


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits