[Skip to main content](#vessel-content)

#   Get the Chinese Char to be displayed correctly

##

- **[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")**
- [![tinachou's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11887-tinachou "View tinachou's Profile") Topic Author
- [ Offline](/forum/user/11887-tinachou)

Less More

- Posts: 107
- Thank you received: 1
-
-

13 years 10 months ago [\#83593](#83593) by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")  *[Get the Chinese Char to be displayed correctly](/forum/4-how-to/77069-get-the-chinese-char-to-be-displayed-correctly#83593 "Hi there,  This is the code which I used to get the chinese name of the customer:  However, the word is garbled.  How can I fix this problem?")* was created by *[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")*

Hi there,

This is the code which I used to get the chinese name of the customer:
Code:

$vars["name"]=@$order-&gt;cart-&gt;$address_type-&gt;address_firstname; echo $vars["name"];

However, the word is garbled.

How can I fix this problem?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MDY5LWdldC10aGUtY2hpbmVzZS1jaGFyLXRvLWJlLWRpc3BsYXllZC1jb3JyZWN0bHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

13 years 10 months ago [\#83919](#83919) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Get the Chinese Char to be displayed correctly](/forum/4-how-to/77069-get-the-chinese-char-to-be-displayed-correctly#83919 "Hi there,  This is the code which I used to get the chinese name of the customer:  However, the word is garbled.  How can I fix this problem?")*

Hi,

Where are you trying to do that ?
Could you give a link ?
It's probably an issue of page encoding and it doesn't require that you change that code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MDY5LWdldC10aGUtY2hpbmVzZS1jaGFyLXRvLWJlLWRpc3BsYXllZC1jb3JyZWN0bHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")**
- [![tinachou's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11887-tinachou "View tinachou's Profile") Topic Author
- [ Offline](/forum/user/11887-tinachou)

Less More

- Posts: 107
- Thank you received: 1
-
-

13 years 10 months ago -  13 years 10 months ago [\#83932](#83932) by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")  Replied by *[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")* on topic *[Get the Chinese Char to be displayed correctly](/forum/4-how-to/77069-get-the-chinese-char-to-be-displayed-correctly#83932 "Hi there,  This is the code which I used to get the chinese name of the customer:  However, the word is garbled.  How can I fix this problem?")*

Dear,

I tested this because I have to link to EZSHIP shipping page. EZSHIP offers an API, and I have to pass the required parameters to EZSHIP.

I wrote the code as follows:
Code:

&lt;?php defined('_JEXEC') or die('Restricted access'); header('Content-Type: text/html; charset=UTF-8'); ?&gt; &lt;?php $user = hikashop_loadUser(true); $address_type = 'billing_address'; // or 'billing_address' $app =&amp; JFactory::getApplication(); $address = $app-&gt;getUserState( HIKASHOP_COMPONENT.'.'.$address_type); $cart = hikashop_get('class.cart'); $cart-&gt;loadAddress($order-&gt;cart, $address, 'object', 'billing'); // or 'billing' $name=$order-&gt;cart-&gt;$address_type-&gt;address_firstname; $vars["phone"]=$order-&gt;cart-&gt;$address_type-&gt;address_telephone; $vars["email"]=$user-&gt;user_email; $currencyClass = hikashop_get('class.currency'); $amount = $currencyClass-&gt;format($order-&gt;order_full_price,$order-&gt;order_currency_id); $bill=$order-&gt;order_full_price; $ship=array( 'su_id' =&gt; 'XXX', 'order_id'=&gt; $order-&gt;order_number, 'rturl' =&gt; 'XXX.php', 'rv_name'=&gt; $name, 'rv_email'=&gt; $vars["email"], 'rv_mobil'=&gt; $vars["phone"], 'rv_amount'=&gt; $bill, 'webtemp'=&gt; $amount ); $ez_temp=$_GET['webtemp']; $href='http://www.ezship.com.tw/emap/rv_request_web.jsp'; if($ez_temp=='') { echo '&lt;/br&gt;&lt;/br&gt;'; echo 'NOW LINKING TO EZSHIP'; echo"&lt;form id=ezship method=POST action='".$href."'&gt;\n"; foreach($ship as $code =&gt; $text){ echo" &lt;input type='hidden' name='".$code."' value='".$text."'&gt;\n"; } echo"&lt;/form&gt;\n"; echo"&lt;script&gt;"; echo"document.forms['ezship'].submit();"; echo"&lt;/script&gt;"; } ?&gt;

The linking is almost okay. The only problem is that when I log in to EZSHIP account and I found the buyer's chinese name in the order records is garbled. I don't know how to fix the problem. Please help me.

BTW, I see the OpenCart has the component of EZSHIP, will Hikaship provide it in the near future?

Sincere thanks. ![:)](/media/kunena/emoticons/3.png ":)")

Last edit: 13 years 10 months ago by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MDY5LWdldC10aGUtY2hpbmVzZS1jaGFyLXRvLWJlLWRpc3BsYXllZC1jb3JyZWN0bHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

13 years 10 months ago [\#84254](#84254) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Get the Chinese Char to be displayed correctly](/forum/4-how-to/77069-get-the-chinese-char-to-be-displayed-correctly#84254 "Hi there,  This is the code which I used to get the chinese name of the customer:  However, the word is garbled.  How can I fix this problem?")*

Hi,

That code sounds ok to me and should not cause that issue.
Try to change type='hidden' to type='text' and see in the fields that are now displayed for your form have the correct text.
If yes, then adding a charset-accept attribute to your form might help:
[ www.w3schools.com/tags/att\_form\_accept\_charset.asp](http://www.w3schools.com/tags/att_form_accept_charset.asp)

If no, then it means that the text is already wrong before your code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc3MDY5LWdldC10aGUtY2hpbmVzZS1jaGFyLXRvLWJlLWRpc3BsYXllZC1jb3JyZWN0bHk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.056 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
