# Help required for Kanji characters in UNIX

**URL:** <https://community.unix.com/t/help-required-for-kanji-characters-in-unix/230257>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [February 4, 2009, 1:48am UTC](https://community.unix.com/t/help-required-for-kanji-characters-in-unix/230257 "2009-02-04T01:48:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![papiya](https://community.unix.com/letter_avatar/papiya/32/6_22734026db12803ebb3e059622ac3534.png) [@papiya](https://community.unix.com/u/papiya)\
**Post date:** [February 4, 2009, 1:48am UTC](https://community.unix.com/t/help-required-for-kanji-characters-in-unix/230257/1 "2009-02-04T01:48:05Z")

</div>

Hi,

I have a flat file containing Japanese(Kanji) characters.When I open it in my desktop it still shows up in Kanji characters. However when I FTP the file to Unix server , the kanji characters are lost and they turn into Junk characters. Can anyone suggest ways in how I can retain the Kanji characters in the UNIX server as well.I have tried ftp\>Bin.....but it doesnt work out. Please help

Thanks  
Papiya

---

<div class="post-metadata">

**Author:** ![quirkasaurus](https://community.unix.com/user_avatar/community.unix.com/quirkasaurus/32/1325_2.png) [@quirkasaurus](https://community.unix.com/u/quirkasaurus)\
**Post date:** [February 5, 2009, 1:06pm UTC](https://community.unix.com/t/help-required-for-kanji-characters-in-unix/230257/2 "2009-02-05T13:06:41Z")

</div>

I think the problem is that the kanji characters are stored in different integer  
notation on one box to the next.

This phenomenon occurs a lot in japanese email, and i think, is called "gojimake".

The solution is nasty:

You must translate the binary values on the computer where the kanji look correct,  
into their ASCII numeric characters. ( ie. 00010010101 into "27182" )

This could be done using a C program.

Then, within html, you can get the Japanese characters by specifying:

\<meta charset='x-euc-jp' \>

in your html at the top....  
and then accessing the spelled out numbers like:

&27182;

This is the preferred method -- as this is not confused between machines  
with different binary integer encoding.

---

<div class="post-metadata">

**Author:** ![quirkasaurus](https://community.unix.com/user_avatar/community.unix.com/quirkasaurus/32/1325_2.png) [@quirkasaurus](https://community.unix.com/u/quirkasaurus)\
**Post date:** [February 5, 2009, 1:35pm UTC](https://community.unix.com/t/help-required-for-kanji-characters-in-unix/230257/3 "2009-02-05T13:35:45Z")

</div>

Oh, and alternative solution:

The names of the different internal integer formats are Big and Little Endian notation.

In the 4 bytes that make up an integer, the first 2  
represent the high bits in one notation -- and the low bits in the other.

You could write a C program to read the file into a long integer,  
swap the high and low order bytes, print it out in ASCII and there you go.

Let me know if you need more help than this.
