Can't convert string from 'UTF-8' to native encoding
Asked Answered
C

1

12

I am getting the following error message when I try to compare my project in eclipse (Team->Compare):

(Can't convert string from 'UTF-8' to native encoding)

***
diff --old /Users/admin/Documents/workspace_branch_2.8/Test --new https://192.168.1.202/svn/main_repository/tenios/Voxtelo/bundle/trunk/Server/Test
    Invalid argument
svn: Kann Zeichenkette nicht von »UTF-8« in die eigene Codierung konvertieren:
svn: 
Eigenschafts?\195?\164nderungen: /Users/admin/Documents/workspace_branch_2.8/Test/src/main/java/org/test/test/internal/commands/Command.java

ZM-Schicht Anforderung gescheitert
svn: Fehler beim Lesen der Antwort auf die REPORT Anfrage von Festplatte
***

However if I run the command:

svn diff --old /Users/admin/Documents/workspace_branch_2.8/Test --new https://192.168.1.202/svn/main_repository/tenios/Voxtelo/bundle/trunk/Server/Test

using command line on mac os, the diff is working without problems. From what I have read, errors like this typically occur when the client has received a string in UTF-8 from the repository, but not all the characters of that string can be displayed in the encoding of the current locale. The output of "locale" is:

LANG="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_CTYPE="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_ALL=

It seems that eclipse does not use those settings, is there an other way to configure locale settings in eclipse? I'm not sure, but maybe the problem is related to javaHL, is there a trace file somewhere?

Collar answered 8/8, 2012 at 16:57 Comment(2)
What does it say when you do Project Properties -> Resource -> Text File Encoding?Hunch
It says inherited from container UTF-8Collar
K
6

JavaHL is only a wrapper to SVN. As i see it JavaHL calls the svn command (svn diff...) and parses the returned message. The command you try to execute returns the info that in this diff some property changed (in german Eigenschaftsänderung). Unfortunately the terminal which handled the call messed up the encoding. The result is a "RA layer request failed" (ZM-Schicht Anforderung gescheitert) which simply means that JavaHL was not able to parse the returned message.

Things you can try:

  1. start eclipse with LC_MESSAGES="en_US.UTF-8" /path/to/eclipse/eclipse and maybe JavaHL will call the svn executable with english messages

  2. check the terminal from which you start Eclipse. Does it support unicode? (rxvt does not, where urxvt does)

    type ä in your terminal and check the output. You should see the ä as readable character. As you can see from my output the character should be encoded as \303\244 and not \195\164 (303 is the octal representation for 195 in decimal, and 244(oct) == 164(dec))

    $ ä
    bash: $'\303\244': command not found
    

Hope this helps.

Klehm answered 15/8, 2012 at 0:47 Comment(1)
starting eclipse with LC_MESSAGE="de_DE.UTF-8" /path/to/eclipse/eclipse fixed the problemCollar

© 2022 - 2024 — McMap. All rights reserved.