Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to edit language characters correctly in index.php


sallyanne

Recommended Posts

I am trying to edit the text on my homepage (index.php) and am having problems saving the index.php file correctly so that foreign language characters (in this case Thai) are displayed.

 

I have been using Wordpad to edit the index.php file and then saving it as text. This seems to lose the encoding for some reason and the Thai text is not displayed in the proper characters.

 

Please help me

Link to comment
Share on other sites

Sorry I don't specifically know the Thai language set but I usually use the Character Map provided with Windows (Start / All Programs / Accessories / System Tools) to find the correct character to copy and paste the code into html.

one-click installation..

Dave's info

Link to comment
Share on other sites

I am still stuck. Should I edit the index.php in notepad. When I do that, what format should I save the file in?

 

When I view the existing index.php (sample which comes as part of the Thai language pack), I am also not able to view the thai characters correctly. They are displayed in gibberish.

 

The real question is how can I change the text so that it is displayed correctly?

Link to comment
Share on other sites

Perhaps you need to change the encoding of the file itself. For instance my files are encoded as Western European, but there are many options, including Thai.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I am still stuck. Should I edit the index.php in notepad. When I do that, what format should I save the file in?

 

When I view the existing index.php (sample which comes as part of the Thai language pack), I am also not able to view the thai characters correctly. They are displayed in gibberish.

 

The real question is how can I change the text so that it is displayed correctly?

 

you cannot view thai language characters if your operating system does not support that language.

If it does, you simply switch to thai, edit the files, save them and make sure that your page encoding is set correctly.

Treasurer MFC

Link to comment
Share on other sites

Thank you for your reply. I am trying to copy and paste the Thai text from a word document into the index.php file. The Thai charaters appear correctly when I paste them, however when I save the page, eventhough I have my web browser encoding set correctly to Thai language, the characters are displayed as gibberish.

Link to comment
Share on other sites

Thank you for your reply. I am trying to copy and paste the Thai text from a word document into the index.php file. The Thai charaters appear correctly when I paste them, however when I save the page, eventhough I have my web browser encoding set correctly to Thai language, the characters are displayed as gibberish.

 

the thai appears correctly when you paste them, also when you re-open the page?

 

what encoding do you use then?

Treasurer MFC

Link to comment
Share on other sites

I am still totally stuck.

 

When I input thai language characters into my index.php file they are displayed correctly (using wordpad as the editor). Once I save the file and view it, the text I inputted is displayed as ????????????????????????????????????????????????????????

 

I think this indicates a problem when I save the file, that the thai language characters are not embedded. I am saving the index.php as a text document. Should I save it as something else? Should I be using another editor instead of wordpad?

Link to comment
Share on other sites

I finally worked out how to display the Thai characters correctly. You need to save the page with UTF-8 encoding. You will see that the Thai characters are now displayed correctly on my page below, however there is another problem. The actual navigation characters for the language pack are showing as gibberish at: http://www.replicaleatherbags.com/

 

Please check this extract from my index.php file:

 

define('TEXT_MAIN', 'About Us<br><br> Replicaleatherbags ขอบคุณลูกค้าทุกท่านที่ให้สละเวลามาเยี่ยมชมเวปไซด์ของเรานะค่ะ ทางร้านเราได้จำหน่ายกระเป๋า รองเท้า และ accessories แบรนด์แนม เกรดระดับ Mirror Image ทุกชิ้น สินค้าของเรามีคุณภาพ และความเหมือนเทียบเท่าของแท้ทุกชิ้น วัสดุในการผลิต รวมถึงรายละเอียดต่าง ๆ มีความใกล้เคียงเหมือนกันของ original มากที่สุด เช่น hardware ของกระเป๋า Louis Vuitton ทำจากทองเหลืองเหมือนของ original ซึ่งจะไม่ลอกไม่ดำ สามารถขัดให้เงาอยู่ตลอดเวลาได้ กระเป๋า Chanel ทำจากหนังแกะ ซึ่งเมื่อสัมผัสจะรู้สึกได้ถึงความนุ่มของเนื้อกระเป๋า เช่นเดียวกับยี่ห้ออื่น ๆ หากคุณลูกค้าท่านใดมีความประสงค์ที่จะสั่งซื้อสินค้าที่ไม่มีในเวปไซด์ของเรา ท่านสามารถสอบถามรายละเอียดกับทางร้านได้ เราจะตรวจสอบรุ่นสินค้าที่ท่านต้องการให้นะค่ะ');

 

The above characters is the correct Thai text which I added.

 

define('TABLE_HEADING_NEW_PRODUCTS', '?Թ???????????Ѻ???͹ %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', '?Թ??ҷ?????ѧ????');

define('TABLE_HEADING_DATE_EXPECTED', '?ѹ????Ҵ??Ҩ??Ҷ֧');

 

The characters is the 3 lines above are the original language pack (Thai characters). These are now displayed as gibberish.

 

I think the only solution is to work out how to convert the characters to be saved in the same way as the original language pack.

 

Can you help?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...