close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Characters Not Displaying Properly

Thread began 3/21/2012 10:37 am by rob294118 | Last modified 3/21/2012 11:25 am by rob294118 | 519 views | 4 replies |

rob294118

Characters Not Displaying Properly

I have some Portuguese text that I'm placing using PowerCMS. For example:

biodegradáveis e amigavelmente ecológico em toda a América do Sul


I have to place this text directly into the database for it to display properly. Otherwise, it displays strange characters.

If I edit the page in PowerCMS, the strange characters are back.

How do I fix this?

Sign in to reply to this post

Jason ByrnesWebAssist

in the Connections/PowerCMSConnection.php file, change line 9:

php:
$PowerCMSConnection = mysql_pconnect($hostname_PowerCMSConnection, $username_PowerCMSConnection, $password_PowerCMSConnection) or trigger_error(mysql_error(),E_USER_ERROR);



to:

php:
$PowerCMSConnection = mysql_pconnect($hostname_PowerCMSConnection, $username_PowerCMSConnection, $password_PowerCMSConnection) or trigger_error(mysql_error(),E_USER_ERROR);

if (!function_exists('mysql_set_charset')) {
     function mysql_set_charset($charset, $link_identifier = null)
     {
         if ($link_identifier == null) {
             return mysql_query('SET NAMES "'.$charset.'"');
         } else {
             return mysql_query('SET NAMES "'.$charset.'"', $link_identifier);
         }
     }
}

mysql_set_charset('utf8',$PowerCMSConnection);
Sign in to reply to this post

rob294118

This didn't work. This is my link: index.php

Here is my line 9:

$PowerCMSConnection = mysql_pconnect($hostname_PowerCMSConnection, $username_PowerCMSConnection, $password_PowerCMSConnection) or trigger_error(mysql_error(),E_USER_ERROR);

if (!function_exists('mysql_set_charset')) {
function mysql_set_charset($charset, $link_identifier = null)
{
if ($link_identifier == null) {
return mysql_query('SET NAMES "'.$charset.'"');
} else {
return mysql_query('SET NAMES "'.$charset.'"', $link_identifier);
}
}
}

mysql_set_charset('utf8',$PowerCMSConnection);

Sign in to reply to this post

Jason ByrnesWebAssist

is this new content?

this change wont fix content that was already broken, it will fix it so that new content is added correctly.


also, the charset meta tag will need to be changed to utf8.


change:
<META NAME http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


to:
<META NAME http-equiv="Content-Type" content="text/html; charset=utf-8" />

Sign in to reply to this post

rob294118

That worked. Thanks.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...