Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

problem with character encoding - UTF-8


Guest

Recommended Posts

Hi, i use oscommerce 2.3.1 and i try new installation with UTF-8 encoding (i use polish characters)..

problem arises when i want to send a message by contact_us or i register a new user.

 

when I receive mail I see the "trees" -> problem with the encoding :)

 

what is wrong? i have mysql in UTF-8 collection too in UTF-8

 

files on ftp are in UTF-8 ... i don't know what is wrong.. in form in php i have code:

 

require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);
 $error = false;
 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
   $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
   $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

   $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
   if (tep_validate_email($email_address)) {
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
  tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
   } else {
  $error = true;
  $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
   }
 }
 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>

 

maybe i need add something in this code? thx for help :) sorry form my english - is not perfect :)

Link to comment
Share on other sites

Have you set UTF-8 as charset in language file

 

Have you looked at the received email headers to check its set there

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Have you set UTF-8 as charset in language file

 

Have you looked at the received email headers to check its set there

 

 

yes, I changed everything to utf-8

but now is OK: )

i changed classes email.php

 

 $this->build_params['html_charset'] = 'utf-8';
  $this->build_params['text_charset'] = 'utf-8';

Link to comment
Share on other sites

eehhhhh

I have a problem with something else :(

 

 

when added to a database record or update it also adds with the bushes ..

 

what is responsible for adding or update to the database? maybe i will change php files ...

 

 

ok ;D i fixed it :)

 

i found it on google:

 

######################################################################
########################## INSTRUCTIONS ##############################
######################################################################
# 1. In {catalog}/{admin}/includes/application_top.php
*** On line ~60, find ***
// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');
*** After that, add ***
// BOF: [TiM's osC Solutions] MySQL I/O UTF-8 Fix
 tep_db_query("SET character set utf8");
// EOF: [TiM's osC Solutions] MySQL I/O UTF-8 Fix
######################################################################
# 2. In {catalog}/includes/application_top.php
*** On line ~77, find ***
// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');
*** After that, add ***
// BOF: [TiM's osC Solutions] MySQL I/O UTF-8 Fix
 tep_db_query("SET character set utf8");
// EOF: [TiM's osC Solutions] MySQL I/O UTF-8 Fix
######################################################################

Link to comment
Share on other sites

i changed classes email.php

 

By default that's set from the charset in language file I mentioned before, perhaps you forgot to check that

 

added to a database record

 

Yes your dBase must be set to use the same charset as everything else, when you stated

i have mysql in UTF-8
you hadn't quite done that!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...