close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

French Characters display as �

Thread began 2/29/2012 12:09 pm by doug425125 | Last modified 5/18/2012 6:27 am by info4753 | 3666 views | 17 replies |

doug425125

French Characters display as �

I'm setting up a second website for a company and working with a translator
to create a proper French language version. I used DataAssist in the original version with no problems for a data base that is used for questions and answers. The search, results and details page as well as every other page associated with the data base is in a utf-8 format. My SQL database tables etc are also set to the utf8 format ( utf8_general_ci ). I am currently getting the � character in place of the missing french characters such as é etc. It is on a testing site at the moment, and in translation transition. All the characters show properly on the main pages, so it's only the data assist created pages that seem to have the problem. There must be some discrepancy in the encoding somewhere between the server, database and data assist files, but I can't quite sort this out. You can see the results on the testing page at soutienmpengo.html Type in "Cherchez" into the search box and the returning answer displays the problem. I currently only have this first answer in french until I sort out the rest and receive the rest of my translations for the database.
Thanks, and any help or suggestions would be appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

you need to force the connection to use the UTF-8 character set, however, this is only availbale in mysql 5.2.4 and above.

in the connection file add the following just before the closing php tag "?>"

php:
mysql_set_charset('utf8',$connectionName);


where connectionName is the name of the connection.

Sign in to reply to this post

doug425125

Thanks for the quick reply Jason. My server is using mysql version 5.1.56
I will ask if they can update the version, but is there any workaround in case they are not able to accommodate me as soon as I'd like? Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

add this code to the connection file just before that line to define the finction if it does not exist:

php:
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);
         }
     }
}
Sign in to reply to this post

doug425125

Thanks Jason.. I'll test this out as soon as I can get to my system. I may have a few more questions.. but this is really great support..

Sign in to reply to this post

doug425125

Hi Jason. I put the code into the connection file and it is still displaying the � character.
I most likely have incorrectly placed the code. It was put into the php file in the Connections folder in the Dreamweaver site. Here is what I put in (with the x's representing the sensitive info like passwords and connection info):

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_xxxxx = "xxx.x.xx.x";
$database_xxxxx = "xxxxxxx";
$username_xxxxx = "xxxxxx";
$password_xxxxx = "xxxxxxxx";
$xxxxx = mysql_pconnect($hostname_xxxxx, $username_xxxxx, $password_xxxxx) 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',$connectionName);
?>

Thanks again for your help

Sign in to reply to this post

doug425125

Sorry, here's an edit to the last post.. I have removed the last line: " mysql_set_charset('utf8',$connectionName); " due to the version of mysql on my server..

Sign in to reply to this post

Jason ByrnesWebAssist

in the line:
mysql_set_charset('utf8',$connectionName);


you need to change "connectionName" to the name of your connection.

that line is just a sample, that you need to modify to use the correct name for your connection.

Sign in to reply to this post

doug425125

Thanks Jason! That worked perfectly. I have much to learn. I put that code back in for the last line, as I had removed it previously, not understanding the protocol. Fantastic support.. thanks again..
Doug

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

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...