Problem with encoding in php site

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shakera
Forum Newbie
Posts: 3
Joined: Fri May 15, 2009 10:23 am

Problem with encoding in php site

Post by shakera »

Hi guys,

I'm not completely sure that this is the right place for my problem, but I think that you'll be able to help me.
Here's the problem. I have wordpressMU and buddypress installed. You can check it here: http://freelanceforum-bg.com/social/. I want some of the stuff translated into bulgarian(thats a cyrillic langauge) - the menus, the titles of the widgets, the footer and so on. So, I began translating the text directly in the php files of the current theme. Here's an excerpt from the header.php file, where the menu is:

Code: Select all

<div id="header">       
        <h1 id="logo"><a href="<?php echo get_option('home') ?>" title="<?php _e( '??????', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
        
        <ul id="nav">
            <li<?php if ( bp_is_page( 'home' ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( '??????', 'buddypress' ) ?>"><?php _e( '??????', 'buddypress' ) ?></a></li>


The problem is that the translated text looks like some kind of rhombs, instead of proper letters, as you can see in the site - the top menu and the footer. The encoding is set to UTF-8, the db charset is set to UTF8 as well and the db-collation is set to utf8_general_ci.
I'll be glad if someone can help. Thanks in advance!
Last edited by Benjamin on Fri May 15, 2009 10:49 am, edited 1 time in total.
Reason: Changed code type from text to php.
ldougherty
Forum Contributor
Posts: 103
Joined: Sun May 03, 2009 11:39 am

Re: Problem with encoding in php site

Post by ldougherty »

Is this on a Windows or Linux server?

Where did you set the encoding?
shakera
Forum Newbie
Posts: 3
Joined: Fri May 15, 2009 10:23 am

Re: Problem with encoding in php site

Post by shakera »

It's a linux server.

I have this code in the wp-config.php file which is the configuration file for wordpressMU.

Code: Select all

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_general_ci');
And about the encoding - it is set in a field named "Encoding for pages and feeds" in the admin CP in wordpress.
shakera
Forum Newbie
Posts: 3
Joined: Fri May 15, 2009 10:23 am

Re: Problem with encoding in php site

Post by shakera »

I solved it. Thanks anyway :)
Post Reply