Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

turkish character problem 2.3.1


zeberrun

Recommended Posts

Posted

hello,

 

will have some questions which i could not find the clear answer in forums even mysql support. this is important to understand mostly for foreign users i think.

i have been using first version of oscommerce, in PHP Version 5.2.9 and mysql 5.0.92-community server w/out problem. control with phpmyadmin.

general collation utf_general_ci, database tables latin5_turkish_ci, collation latin1_swedish_ci works perfect.

functions/database.php mysql_query("SET NAMES 'latin5'") is written. ISO-8859-9 written in catalog and admin turkish.php.

 

i have passed in test envoi. for 2.3.1 last week. except functions/database.php mysql_query("SET NAMES 'latin5'") i have done everything like old version but it does not support turkish characters. but some characters are written with ? to database. changed to collation latin5_turkish_ci, utf-8, changed utf-8 written in catalog and admin turkish.php the mistake still there.

but different from old version, i try to use english files as turkish. i translated english.php to turkish(in admin and catalog), translated english folder files to turkish, since i will not use another language.

the questions

1- a turkish user must create database tables latin5_turkish_ci and collation latin5_turkish_ci ?.

2- admin and catalog turkish.php has ISO 8859-9?

3- admin and catalog turkish.php utf-8 works perfect with database tables latin5_turkish_ci and collation latin5_turkish_ci ?

 

4- the problem could be trying to use english as turkish?

 

regards

Posted

here we are, the results.

 

1- tables must be latin5_turkish_ci, collation must be latin1_swedish_ci. maybe collation latin5_turkish_ci is acceptable, i did not tested.

if r tables are created with latin1 u must use alter table command, or u can reorganize from phpmyadmin.

 

2- admin and catalog must be 8859-9. datepicker must tr and must be translated to turkish some characters are wrong.

 

@setlocale(LC_TIME, 'tr_TR.ISO_8859-9');

define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()

define('DATE_FORMAT_LONG', '%d %B %Y, %A'); // this is used for strftime()

define('DATE_FORMAT', 'd/m/Y'); // this is used for date()

define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

define('JQUERY_DATEPICKER_I18N_CODE', 'tr'); // leave empty for en_US; see http://jqueryui.com/demos/datepicker/#localization

define('JQUERY_DATEPICKER_FORMAT', 'dd/mm/yy'); // see http://docs.jquery.com/UI/Datepicker/formatDate

////

// Return date in raw format

// $date should be in format mm/dd/yyyy

// raw date is in format YYYYMMDD, or DDMMYYYY

function tep_date_raw($date, $reverse = false) {

if ($reverse) {

return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);

} else {

return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);

}

}

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'TRL');

// Global entries for the <html> tag

define('HTML_PARAMS', 'dir="LTR" lang="tr"');

// charset for web pages and emails

define('CHARSET', 'iso 8859-9');

 

3- no need for test this. there is utf-8_turkish_ci table character but i could not find right knowledge about it.

 

4- i left language files and folders as it is. what i have changed is shown above.

Posted

but we have a problem which we could not see turkish characters in mysql database. i can see turkish characters in database in older version. i tried in includes/functions/database.php, mysql_query("SET NAMES 'latin5'") but i can not see characters and also add turkish characters to database. any help ?

Posted

dear turkish user, take a sit and enjoy the programm, no more search.

 

be able to see the turkish characters in mysql database (just for version mentioned above) you have to make all the tables latin5, and COLUMNS (inside the tables) must latin5. alter table command may not make latin5 the columns of tables database collation can be latin1 swedish.

 

in catalog and admin language php. (turkish.php) mysql_query("SET NAMES 'latin5'"); must be added,

 

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {

error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);

}

mysql_query("SET NAMES 'latin5'");

 

$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {

$result_error = mysql_error();

error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);

}

return $result;

 

result turkish characters correct in website and database.

 

regards

Archived

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

×
×
  • Create New...