LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   scp command and internaltion characters (https://www.linuxquestions.org/questions/linux-general-1/scp-command-and-internaltion-characters-790486/)

kkruecke 02-20-2010 09:21 PM

scp command and internaltion characters
 
When I upload a file usind the scp that contains the German characters ü, ö, or ä, these characters get changed to �. For example, a sentence in an html file like this

Ein Unternehmen ist oft viel grösser als ein Betrieb und beschäftigt viel mehr Arbeitnehmer.

looks like this

Ein Unternehmen ist oft viel gr�sser als ein Betrieb und besch�ftigt viel mehr Arbeitnehmer.

Why are this characters getting changed?

thanks.

jschiwal 02-20-2010 09:29 PM

Are you talking about the contents of the file or the filename. I doubt that scp would change the character encoding of a file. It is more likely that your terminal on the target server doesn't use utf8 encoding.

kkruecke 02-20-2010 09:36 PM

Thanks for the reply. I am talking about the contents of the file. You can see it here:
http://www.kurttest.com/de/index.php...13/uebung.html

jschiwal 02-21-2010 06:29 AM

Just to verify what happens on my system, I cut and pasted your text to a file, and used scp to copy it to my desktop to verify that it retained the characters.

I would suggest a test where you use scp to copy the file to the remote server and then use scp to copy it back under a different name. Then run "cmp <original> <copy>".

Could you enter the command "locale" on the ssh client and remote ssh server computer and post the results. I am thinking that the server doesn't have utf8 support. If you cut and paste text from the terminal, or a program that doesn't have utf support, you might loose characters that don't exist in the terminal or program's character set.

Also run "file <textfile>" to print out which character set is used.

knudfl 02-21-2010 06:33 AM

http://www.kurttest.com/de/index.php...13/uebung.html
Seems to be a site error.
Please right click and choose "View Page Source" : Same errors.

Any other German site will show the correct letters, ä ö ü ß :
http://www.debian.org/distrib/packages.de.html

.....

jschiwal 02-21-2010 10:50 AM

knudfl: The OP's problem is with files that he copied using scp, and not viewing web sites.

kkruecke 02-21-2010 11:32 AM

I don't think it is scp. I downloaded the file from the server using scp, gave it a a different name, and ran cmp
> cmp uebung.html uebung-down.html

The files are identical. The file does not display the German letters--ä ö ü ß--properly locally, either.

http://localhost/de/marktplatz/les13/uebung.html

gives the same output as on the server. The uniquely German characters dispaly as �. But here is what is weird. When I edit the file on the server using vim

/var/www/kurttest.com/de/marktplatz/les13$ vim uebung.html

the German characters display as �. But, if I view the file locally, on my desktop machine, using Gvim or gedit the German characters display properly. Furthermore, while editing the file, if I do "view in Firefox" (using the gedit plugin, or, if I edit with Gvim, the Gvim equivalent capability), the German characters appear properly.

Locally, I have language-pack-de, language-pack-de-base and language-pack-gnome-de, the German language packs, installed. But they are not installed on the server. Maybe that explains why the files display o.k. locally when edited?

What is weird is that only this particular file is not displaying properly. I have a index.php file that calls the php readfile() function, to read the individual files.


All times are GMT -5. The time now is 05:29 PM.