Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql and latin1
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
saqueter
n00b
n00b


Joined: 26 Jun 2007
Posts: 1

PostPosted: Wed Jun 27, 2007 4:04 pm    Post subject: mysql and latin1 Reply with quote

Hi all
I have installed apache Server version: Apache/2.0.58 on my gentoomachine and wanted to run a phpBB2 forum there.
The thing is that i want to use latin1 since most members are from Sweden.
I installed mysql Ver 14.12 Distrib 5.0.40 with support for latin1 and PHP 5.2.2-pl1-gentoo with Suhosin-Patch 0.9.6.2 (cli).
I added the swedish languagepack, and it worked nicely :)
The thing is that swedish characters (åäö) won't work in the forum.
If i type a swedish character somewhere in a post, it will not display anymore of the post from the letter before the first swechar.
Tried every tip in the forum (i think?), but can't get it to work properly :/
Getting desperate.... Can any1 help me out?
Back to top
View user's profile Send private message
Scoody
n00b
n00b


Joined: 28 Jan 2005
Posts: 69
Location: Norway

PostPosted: Wed Jun 27, 2007 5:11 pm    Post subject: Reply with quote

You won't see anything after the åäö, because it gets truncated. Check what character set the server is using, and also you database/tables.
It can be done easily with phpMyAdmin, as I don't remember how to do it from the commandline.. :p

I had the same problem, and changing that fixed it.
_________________
Scoody.
Back to top
View user's profile Send private message
jiangtao
Tux's lil' helper
Tux's lil' helper


Joined: 16 Mar 2004
Posts: 80

PostPosted: Tue Jul 03, 2007 3:38 pm    Post subject: Reply with quote

Try to edit the source , following the mysql_connect(); line
Add

mysql_query("SET character_set_connection=".$charset.", character_set_results=".$charset.", character_set_client=binary");
OR
mysql_query("SET NAMES ". $charset);

AND if you backup/restore the sql-data with mysql-command-line ,you need run that sql query command *FIRST*.

It is working in Itemstats ( If you play the World of WarCraft, you will know what is that. :-P ) with Chinese GBK charset.


Like that:
Code:

        else
        {
            $this->db = mysql_connect($dbhost, $dbuser, $dbpass, $bNewConnection);
            mysql_query("set names gbk",$this->db );            // Add in here
        }
        if ($bNewConnection)
            $GLOBALS["connectionId"] = $this->db;

Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum