0

I created a file that is in UTF-8 encoding. This file contains chinese characters.

When I sftp the file from my macbook into the ubuntu 14.04 server headless, the Chinese characters become diamond shape.

When I look at the file (either via SSH or directly on the machine itself using a CRT monitor), the file always appears as diamond shaped.

The language locale of the ubuntu is en_US.UTF-8

How do I

a) either somehow retype the characters inside the ubuntu headless 14.04?

Or

b) transfer the file over and still have the chinese characters rendered correctly?

UPDATE

I mean I have no GUI on the 14.04 ubuntu server edition. The files whenever I open using vim or nano or whatever editor keep showing up the chinese characters as diamond shape things.

  • added a line that says the diamond shaped always appears regardless i use SSH terminal or directly on the machine's terminal. – Kim Stacks Dec 12 '16 at 8:34
0

A "headless" server cannot display anything -- not Latin letters, not Chinese characters; it is headless. It is your terminal / web browser / whatever application you use locally which displays the characters. You are looking at the wrong end of the pipe; for example, the picture below show how a program on the server will send the character <U+7F51> (网, wǎng, "net", "network") to an application on the local machine:

User     Local machine                  Headless server
        ______________                    ____________
 ( )   |  __________  |                  |            |
 /|\   | | Terminal | |  \xE7 \xBD \x91  |            |
/ | \  | |          | |<-----------------|  <U+7F51>  |
  |    | |    网    | | (UTF-8 encoding) |            |
 / \   | |__________| |                  |            |
/   \  |______________|                  |____________|
  • Apologies, I mean I have no GUI on the 14.04 ubuntu server edition. The files whenever I open using vim or nano or whatever editor keep showing up the chinese characters as diamond shape things. – Kim Stacks Dec 12 '16 at 8:22
  • Are you running the editor on a virtual console, or are you running it in a terminal connected via SSH? – AlexP Dec 12 '16 at 8:29
  • Sorry if I use my terms badly, but basically I installed ubuntu 14.04 server edition (no GUI) on a dell machine (which is always fixed with a CRT monitor) and it opens up the terminal after login. So not using SSH at all. – Kim Stacks Dec 12 '16 at 8:32
  • Well, a Linux virtual console (the terminal shown by Ubuntu server on a display directly attached to the computer) cannot display more than 512 characters, which is enough for alphabetic scripts but obviously not enough for the Chinese script. Your files are all right, it's just the terminal which cannot show them. – AlexP Dec 12 '16 at 8:34
  • I see. When I run my python code, it fails at the lines with the Chinese characters ( I am trying to export a Excel file using python which contains chinese characters inside the cells). So I guess the problem is somewhere else? – Kim Stacks Dec 12 '16 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.