1.1Beta3 with utf-8

Started by CapriSkye, July 07, 2005, 12:22:39 PM

Previous topic - Next topic

CapriSkye

this only happen with 1.1, it used to run fine with utf-8.
i'm using mysql 4.1, with default character set of utf-8.
after installing 1.1, not change the default language, and going into my pm i get this:

Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'find_in_set'
File: D:\website\capriskye\forum\Sources\PersonalMessage.php
Line: 365


in PersonalMessage, around line 365 is this:

$request = db_query("
SELECT COUNT(pmr.ID_PM)
FROM {$db_prefix}pm_recipients AS pmr
WHERE pmr.ID_MEMBER = $ID_MEMBER
AND pmr.deleted = 0$labelQuery", __FILE__, __LINE__);
list ($max_messages) = mysql_fetch_row($request);
mysql_free_result($request);


it's a fresh install, no mod no anything.
i tried to change EVERYTHING to utf-8 in phpmyadmin, but fields with UNSIGNED attribute cannot be changed to utf-8. selecting it would simply do nothing.

any idea? thanks

[Unknown]

Try adding:

$mysql_set_mode = true;

To Settings.php, before the ?>.

-[Unknown]

CapriSkye

still same
what does that do?

CapriSkye

after searching google, the closest info i get is this
http://bugs.mysql.com/bug.php?id=11016

CapriSkye

the error goes away if i manually change pm_recipients table's labels column to latin1
not sure if that will cause any problem though since i'm using utf-8 throughout and only that column is latin1.

CapriSkye

if i add this
@mysql_query("SET NAMES UTF8");
to index.php, i won't have to change pm_recipients to latin1
fyi

RoyceMcKnight

i am having the same problem here with my smf board 1.1beta running utf-8.
mysql default charset is set to utf-8 and all the smf tables are unicode too.

if i try to read private messages i get the same error as discribed in the very first post.

i also tried this
1.
add $mysql_set_mode = true;
to Settings.pgp
2.
add
@mysql_query("SET NAMES utf-8");
@mysql_query("SET CHARACTER SET utf-8")
to index.php

but it still doesn't work.

does anyone know how to fix this?


have a nice day

mike

CapriSkye

change utf-8 to utf8
and add @mysql_query right before this line
// Load the settings from the settings table, and perform operations like optimizing.
and you don't need set character set because set names utf8 will do it automatically, it sets everything to utf8.
that certainly solve the problem for me.

RoyceMcKnight

big merci to you. i must be blind ;)
i changed that line and now it works pretty well

Elmacik

We faced up the same problem on personal message page. But none of the solutions above did our trick.
Maybe because our server is windows.
I searched all the boards but couldnt find any solutions other than here.
Anyone knows about it?

Here is the full error when clicked to PMs link:

Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'find_in_set'
Dosya: D:\inetpub\internetkurdu\internetkurdu.net\www\adf\Sources\PersonalMessage.php
Satır: 390
Home of Elmacik

CapriSkye

i believe rc2 fixed that problem

Elmacik

Quote from: CapriSkye on March 13, 2006, 07:51:44 AM
i believe rc2 fixed that problem
No I dont think so. I didnt try manually doing this though.
Home of Elmacik

H

Wonderful thread bump ::)

RC2 does not fix most UTF-8 problems although they will be fixed in the final 1.1 release
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Elmacik

#13
I solved my problem changing the collations inside the tables (columns)
I ran this queries to solve it:

ALTER TABLE `smf_personal_messages` CHANGE `fromName` `fromName` TINYTEXT CHARACTER SET latin1 COLLATE latin1_general_ci;
ALTER TABLE `smf_personal_messages` CHANGE `subject` `subject` TINYTEXT CHARACTER SET latin1 COLLATE latin1_general_ci;
ALTER TABLE `smf_personal_messages` CHANGE `body` `body` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci;
ALTER TABLE `smf_pm_recipients` CHANGE `labels` `labels` VARCHAR( 60 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL default = '-1';

This means if your server is Windows, you generally suck :P You probably have a server not well-configured, or something wrong in SMF.. ?
Home of Elmacik

Advertisement: