Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Greek language - utf8


nikolouli

Recommended Posts

Hello, i have tha last version of OSC, and i download the greek language, is there a greek language utf-8? if no, how i change it to ut8? i must change all files at utf8?

 

I have and an other BIG problem too, when i make a New category at catalog, and when i give a name on Greek, i get this -> Δερμά - Βιβλί - Υαλικ ,after 5 characters i get . how do i fix this?

Plz helpppp :( :( :( :( :(

Link to comment
Share on other sites

  • 2 weeks later...
Hello, i have tha last version of OSC, and i download the greek language, is there a greek language utf-8? if no, how i change it to ut8? i must change all files at utf8?

 

I have and an other BIG problem too, when i make a New category at catalog, and when i give a name on Greek, i get this -> Δερμά - Βιβλί - Υαλικ ,after 5 characters i get . how do i fix this?

Plz helpppp :( :( :( :( :(

 

Λοιπόν φίλε μου δυστυχώς θα πρέπει μόνος σου να μετατρέψεις όλα τα αρχεία σε UTF-8 (τα αρχεία της μετάφρασης και σχεδόν όλα τα άλλα αρχεία). Σου συνιστώ να το κάνεις με το Dreamweaver, αν δεν το έχεις τότε φαντάζομαι το Notepad2+ μπορεί να τα κάνει κι αυτό, ψάξτο στο google κάτι θα βρεις! Είχα περάσει κι εγώ αυτό το λούκι στο site www.spectraarchive.gr και έφαγα πολλές ώρες να το φτιάξω, καθώς έπρεπε να κάνω και την mysql σε UTF8.

 

Τώρα όσον αφορά το ότι σου δίνει τα πρώτα 5 γράμματα μάλλον θα έχει να κάνει με την όλη κατάσταση που δεν είναι σε UTF8. Κάνε την μετατροπή και δες μετά τι θα παίξει :)

There's a diference between living & BEING ALIVE!

Link to comment
Share on other sites

  • 2 months later...

Η λύση είναι πολύ απλή πήγαινε στο /catalog/includes/functions και κάνε edit το database.php. Βρές το παρακάτώ function

 

  function tep_db_query($query, $link = 'db_link') {
   global $$link;

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
     error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
   }
   $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;
 }

και πρόσθεσε το

	mysql_query(' set character set utf8 ');
mysql_query("SET NAMES 'utf8' ");

ακριβώς πριν το $result. Οπότε τώρα πλέον θα πρέπει να είναι όπως το παρακάτω:

  function tep_db_query($query, $link = 'db_link') {
   global $$link;

   if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
     error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
   }
mysql_query(' set character set utf8 ');
mysql_query("SET NAMES 'utf8' ");
   $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;
 }

Το ίδιο πρέπει να κάνεις και στο admin κομμάτι στο file: /catalog/admin/includes/functions/database.php

 

Filika

Link to comment
Share on other sites

I have a similar problem. I do have the greek translation installed, the character code is ISO-8859-7 and everything works fine in both the catalog and the admin side. The only - and big - problem is in the database side.

 

I use phpMYadmin 2.11.0 and MySQL client version: 4.1.22 and the character set of MySQL is : UTF-8 Unicode (utf8) while i have MySQL connection collation: utf8_unicode|_ci

 

The tables are in latin1_ swedish_ci and this is what i get when i input τεστ δοκιμη

 

ôåóô äïêéìç

 

Ive tried the above

 

mysql_query(' set character set utf8 ');

mysql_query("SET NAMES 'utf8' ");

 

also added in line 21 of database php files the following

 

mysql_query("SET NAMES 'UTF8'", $$link);

 

changed also the UTF8 part into ISO-8859-7 but with no luck.

 

I am lost, dont know much about sql and nothing on the varius character sets and what i need to do is to export the tables ( products, categories etc ) edit them with excel and upload them again.

 

Thanks in advance. Ευχαριστώ.

Link to comment
Share on other sites

  • 3 weeks later...

Καλησπέρα σας! Θα ήθελα να μου πείτε που βρίσκεται η μεταβλητή CHARSET που δηλώνεται σε όλες τις σελίδες του catalog. Έτσι μπορούμε να εμφανίζουμε τα ελληνικά στοιχεία πραγματικά ελληνικά αλλάζοντας το CHARSET σε windows-1253.

 

Με τη βάση, προσωπικά, δεν είχα πρόβλημα με τα ελληνικά, αλλά με την κωδικοποίηση της σελίδας index.php και όσων σελίδων εμφανίζονται στο catalog (π.χ. account.php, login.php κλπ).

Link to comment
Share on other sites

  • 1 month later...

To continue to my problem, ive tried a clean installation of osCommerce, added the greek language files which are in utf-8 this time and not in iso 8859-7, and had similar results. The site show all languages ( including greeks ) fine, the admin is also ok, i can import new products ok but ........ when i try via phpmyadmin to see and off course download some tables, par example products_descriptions, everything looks like ...... chinese. The same with both firefox and IE7. :angry:

 

I am desperate. I cna not even think the trouble of adding even 100 products one by one.

 

Please help..... :(

Link to comment
Share on other sites

  • 2 weeks later...

Hi at all. I have install greek language, but i have problem with the manufactors names. I have add a manufactor with name Ελληνικά Γράμματα, and when i visit my shop and check manufactors(without login..as a guest) the name of manufactors is not right. It seems that its not enconding. How i can fix that?

 

sorry for my poor english...

Link to comment
Share on other sites

  • 7 months later...

like i ve posted on another related thread:

 

"just for your info, i ve uploaded the utf8 greek language files

i ll also upload the database files that should be changed in order to have a full functional oscommerce website with greek and utf8"

 

just browse "Contributions" under my account and u ll find mentioned files

Hello world!

Link to comment
Share on other sites

Hi guys

I came across this a while back in the contributions.

Not my work so dont giveme any credit all credit to the author

 

I am using the osCommerce RC2 with Greek Language utf-8.. While i was exploring in the mysql

i saw that the whole language were corrupted.. In the site it was looking good, but in the mysql

were TOTALLY corrupted and that a problem..

 

After all i found a solution..

 

### open includes\functions\database.php ####

And find this :

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

if ($$link) mysql_select_db($database);

 

return $$link;

}

 

 

 

 

#### And replace with this ####

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

} else {

$$link = mysql_connect($server, $username, $password);

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

}

 

if ($$link) {

mysql_select_db($database);

tep_db_query('SET time_zone=\'' . CONFIG_TIME_ZONE . '\'');

}

 

return $$link;

}

 

 

 

Do the same for the admin\includes\functions\database.php

 

I hope this helps some people who may have the same problems as me..

 

Onoufriadis Christoforos

http://www.turbosim.gr

17 July 2008

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Link to comment
Share on other sites

This is more or else my contribution!

 

Hi guys

I came across this a while back in the contributions.

Not my work so dont giveme any credit all credit to the author

 

I am using the osCommerce RC2 with Greek Language utf-8.. While i was exploring in the mysql

i saw that the whole language were corrupted.. In the site it was looking good, but in the mysql

were TOTALLY corrupted and that a problem..

 

After all i found a solution..

 

### open includes\functions\database.php ####

And find this :

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

if ($$link) mysql_select_db($database);

 

return $$link;

}

 

 

 

 

#### And replace with this ####

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

} else {

$$link = mysql_connect($server, $username, $password);

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

}

 

if ($$link) {

mysql_select_db($database);

tep_db_query('SET time_zone=\'' . CONFIG_TIME_ZONE . '\'');

}

 

return $$link;

}

 

 

 

Do the same for the admin\includes\functions\database.php

 

I hope this helps some people who may have the same problems as me..

 

Onoufriadis Christoforos

http://www.turbosim.gr

17 July 2008

Hello world!

Link to comment
Share on other sites

  • 2 weeks later...

I found that strtolower in combination with utf-8 caused the problem in includes/functions/general.php. I changed the function tep_parse_search_string.

 

Old:

  function tep_parse_search_string($search_str = '', &$objects) {
$search_str = trim(strtolower($search_str));

 

New:

  function tep_parse_search_string($search_str = '', &$objects) {
$search_str = trim($search_str);
$search_str = mb_convert_case($search_str, MB_CASE_LOWER, "utf-8");

 

To correct the e-mail subject, you have to correct (admin/catalog) includes/classes/email.php

 

Old:

	  $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr);
  $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);

 

New:

//note that charset in the language file is defined as UTF-8 (not UTF8)
  $tommod_encoding = strtolower(constant('CHARSET'));
  if($tommod_encoding=="utf-8"){
  mb_internal_encoding("utf-8");
  $subject = mb_encode_mimeheader($subject, "utf-8", "q");
  $from_name = mb_encode_mimeheader($from_name, "utf-8", "q");
  }

  $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr);
  $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);

 

Until the next php/utf8 problem ;)

Link to comment
Share on other sites

Have tried in the past what makis77 and Cristoforos suggested but the catalog part did not look ok with the original database

 

so I decided that if i works I should leave it as it is.

 

Is there any way to download the database through the admin so that it has the funny characters instead of greek characters ?????

 

The point is that if you restore the db trough the admin you might yet the ???????? and every time i have used that backup on a test server i get ?????####### characters

Link to comment
Share on other sites

Probably you are using ascii (iso-8859-7) characters. When you export the database with phpmyadmin the Greek characters look disformed. It is no problem, when you import the file again through phpmyadmin just set the "character set of file" to binary.

Link to comment
Share on other sites

  • 10 months later...

I made a clean install of osCommerce. I am trying to enable greek language.

 

When I go to admin and try to enter a greek name on the store name (ie [store name] = "abcd αβγδ"), then what is displayed on the osCommerce admin is:

abcd αβγδ

 

Then I go to the phpmyadmin (sql server) and I also see corrupted greek chars in the field.

 

 

I downloaded and installed makis77's contributions:

Greek utf8

Greek utf8 database files

 

 

But NOTHING changed. Any ideas?

 

The store s located at http://ortf.gr/catalog/

Link to comment
Share on other sites

>>>>>>>>>>>>>

then what is displayed on the osCommerce admin is:

abcd αβγδ

<<<<<<<<<<<<<

 

SORRY, I meant to write:

>>>>>>>>>>>>>

then what is displayed on the osCommerce admin is:

abcd & #945;& #946;& #947;& #948;

<<<<<<<<<<<<<

(I had to add the spaces between & and #, otherwise it would display the "αβγδ" perfectly.

 

This is displayed on the VIEW form (Administration --> My Store).

 

What I just noticed is that on the first page of the admin, it displays normaly:

abcd αβγδ

Link to comment
Share on other sites

Not sure if this helps or not - Greek is one of the languages I have on my site and it seems to run ok.

 

My database is set to utf8_unicode_ci so everything that is entered from my osCommerce to the database in greek translates to entity or decimal characters (eg β = & beta ; or & #946 ; ) This is also the only way I have managed to validate RSS feeds in Greek as well

My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Link to comment
Share on other sites

Not sure if this helps or not - Greek is one of the languages I have on my site and it seems to run ok.

 

My database is set to utf8_unicode_ci so everything that is entered from my osCommerce to the database in greek translates to entity or decimal characters (eg β = & beta ; or & #946 ; ) This is also the only way I have managed to validate RSS feeds in Greek as well

 

My database (from phpmyadmin) is also utf-8. So you say from the phpmyadmin you see the funny chars (& #946), but the osCommerce displays the greeks correctly? I could live with this. ok, what steps did you take to achieve this?

Link to comment
Share on other sites

My database (from phpmyadmin) is also utf-8. So you say from the phpmyadmin you see the funny chars (& #946), but the osCommerce displays the greeks correctly? I could live with this. ok, what steps did you take to achieve this?

 

I actually did nothing - php and Sql does it all for me (I think) As I understand it the Sql database stores everything as utf8 and will convert it to entity, decimal or hex coding, this only works where the data is stored in the database of course not for anything written in the language files.

 

To achieve this page I put the Greek text into the description, the database stores it as character entity references (your funny chars ;) ) but then it is converted back on my site for reading.

 

In order to get RSS feeds working and validated for languages other than English I've had to convert parts of the language files to entity or decimal coding as well.

 

 

<EDIT> BTW I'm still using the utf8 version of the Greek language file but it does not make a difference A lot of my other languages are windows-1251, gb2312 or iso-8859-1 but they all work the same way using the Sql database</EDIT>

My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Link to comment
Share on other sites

I tried everything on this thread. It had absolutely no effect on my problem.

 

I still get & #945;& #963;& #948;& #966;& #947; instead of greek chars.

 

And when I go to set the language, I see :

Greek-Ελλη

 

Anybody can help me?

 

(Είμαι έτοιμος να τα παρατήσω και να πάω σε Joomla)

Link to comment
Share on other sites

  • 1 month later...

Καλημέρα

Λοιπόν, πρέπει να αλλάξεις το collation των αντίστοιχων πινάκων από το PHPmyadmin για την βάση σου σε UTF8_general_ci, να προσθέσεις κώδικα στο database.php gai να βλέπει UTf8, να αλλάξεις την κωδικοποίηση στον browser που χρησιμοποιείς σε UTF8

 

Ελπίζω να βοήθησα

Βάσω

 

 

I tried everything on this thread. It had absolutely no effect on my problem.

 

I still get & #945;& #963;& #948;& #966;& #947; instead of greek chars.

 

And when I go to set the language, I see :

Greek-Ελλη

 

Anybody can help me?

 

(Είμαι έτοιμος να τα παρατήσω και να πάω σε Joomla)

Link to comment
Share on other sites

  • 1 year later...

Hi guys

I came across this a while back in the contributions.

Not my work so dont giveme any credit all credit to the author

 

I am using the osCommerce RC2 with Greek Language utf-8.. While i was exploring in the mysql

i saw that the whole language were corrupted.. In the site it was looking good, but in the mysql

were TOTALLY corrupted and that a problem..

 

After all i found a solution..

 

### open includes\functions\database.php ####

And find this :

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $link;

 

if (USE_PCONNECT == 'true') {

$link = mysql_pconnect($server, $username, $password);

} else {

$link = mysql_connect($server, $username, $password);

}

 

if ($link) mysql_select_db($database);

 

return $link;

}

 

 

 

 

#### And replace with this ####

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $link;

 

if (USE_PCONNECT == 'true') {

$link = mysql_pconnect($server, $username, $password);

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

} else {

$link = mysql_connect($server, $username, $password);

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET NAMES utf8");

 

}

 

if ($link) {

mysql_select_db($database);

tep_db_query('SET time_zone=\'' . CONFIG_TIME_ZONE . '\'');

}

 

return $link;

}

 

 

 

Do the same for the admin\includes\functions\database.php

 

I hope this helps some people who may have the same problems as me..

 

Onoufriadis Christoforos

http://www.turbosim.gr

17 July 2008

 

I tried this and i get this

 

1298 - Unknown or incorrect time zone: 'CONFIG_TIME_ZONE'

 

SET time_zone='CONFIG_TIME_ZONE'

 

[TEP STOP]

any clues re a solution?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...