UTF-8 in linux

Has anyone had any problems with UTF-8 in IDEA on Linux?

I've created an issues but they think it's just a font issue.
http://www.jetbrains.net/jira/browse/IDEA-10002

I was wondering if others could see UTF-8 characters inside java files. I have set the encoding type to UTF-8. The font is on default but I've tested other font types with no luck.

I've attached a Test.java file, download it and see if you can view it in IDEA.

OS
Linux 2.6.17-1.2187_FC5 #1 SMP Mon Sep 11 01:16:59 EDT 200 6 x86_64 x86_64 x86_64 GNU/Linux

Java
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_09-b01, mixed mode)



Attachment(s):
settings.png
cat.png
gedit.png
Test.png
Test.java
12 comments

We have several mac IDEA users here at work and none of them have this problem. Unfortunatly, I'm the only Linux IDEA users here at work. That's why I need someone other Linux IDEA users to test this for me. I need to find out if I have someone messed up on my system or if it's a bug in IDEA.

0

Hi Eric!

Has anyone had any problems with UTF-8 in IDEA on Linux?


I am also a Linux user and here UTF-8 works as expected, though, I tried
your Test.java and get the same erroneous output as you.

So I tried this little java code:

FileReader fr = new FileReader("/home/im/tmp/Test.java");
char[] buf = new char[1024];
int read;

while ((read = fr.read(buf)) > -1)
{
System.err.println(new String(buf, 0, read));
}
fr.close();

From within the IDEA console window the output shows the same error, but
if I start it from a xterm I get the correct output :-o

For me - but I am not an expert - it looks like there is a font missing,
maybe skim through the document I found using google (I don't know
if there is a java 1.5 version too)
Maybe it allows you to fix the issue

Ciao,
Mario


http://java.sun.com/j2se/1.3/docs/guide/intl/fontprop.html

0

Mario,

Perfect that what I wanted you to confirm. I think it's a bug in IDEA. I had several of the mac guys here at work load up that Test.java file and it works fine for them. I'll take a look into the fontprop, maybe there is a workaround.

Here is an interesting thing, UTF8 has work with previous version of IDEA. I believe the earlier version of IDEA 5 worked.

Eric

0

Could you please set the editor font that is definitely able to display
these characters in the Settings|Appearance ?

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Eric Neilsen" <no_reply@jetbrains.com> wrote in message
news:30525487.1161037716109.JavaMail.itn@is.intellij.net...

Has anyone had any problems with UTF-8 in IDEA on Linux?

>

I've created an issues but they think it's just a font issue.
http://www.jetbrains.net/jira/browse/IDEA-10002

>

I was wondering if others could see UTF-8 characters inside java files. I
have set the encoding type to UTF-8. The font is on default but I've
tested other font types with no luck.

>

I've attached a Test.java file, download it and see if you can view it in
IDEA.

>

OS
Linux 2.6.17-1.2187_FC5 #1 SMP Mon Sep 11 01:16:59 EDT 200 6 x86_64 x86_64
x86_64 GNU/Linux

>

Java
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_09-b01, mixed mode)



0

I have changed the setting appearances and that hasn't had any effect. I've also listend to what

Sascha Weinreuter said "If the file loads and saves correctly it's a font issue. You will need to select an editor font that is capable of displaying the characters your file represents (which is btw independent of the file being UTF-8 encoded)."

that hasn't worked either. Mario Ivankovits is also having the same problem.

0

What font you have in Settings|Appearance|Font ?
What font you use in other utilitiy, screenshots of which you have posted
earlier ?

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Eric Neilsen" <no_reply@jetbrains.com> wrote in message
news:9818112.1161281202845.JavaMail.itn@is.intellij.net...
>I have changed the setting appearances and that hasn't had any effect. I've
>also listend to what
>

Sascha Weinreuter said +"If the file loads and saves correctly it's a
font issue. You will need to select an editor font that is capable of
displaying the characters your file represents (which is btw independent
of the file being UTF-8 encoded)."+

>

that hasn't worked either. Mario Ivankovits is also having the same
problem.



0

Eric Neilsen wrote:

Has anyone had any problems with UTF-8 in IDEA on Linux?
I've created an issues but they think it's just a font issue.
http://www.jetbrains.net/jira/browse/IDEA-10002
I was wondering if others could see UTF-8 characters inside java files. I have set the encoding type to UTF-8.


It is a font issue - I'm running IDEA 6 on linux as well, and I can see
the characters just fine (in the editor, and in the output pane) - see
screenshot.

I'm using 'Bitstream Vera Sans Mono' as my editor font.

Hope this helps...

Regards,
Edwin



Attachment(s):
characters.png
0

I've uploaded more screen shots to the issue: http://www.jetbrains.net/jira/browse/IDEA-10002

Font in settings|Appearance|font = I've tried most of them. Right now I have it set to monospace in IDEA. In gedit (the default gnome text editor) I can change the font to any font in gedit and works fine. None of the fonts seem to show UTF8 in IDEA.

Futhermore, in gnome terminal I can view the fonts in UTF8 (screenshot cat.png). So I know my system can read and display utf8. For somereason it's not working in IDEA.

0

Ok, well I'm convinced that it works. I somehow must have some sort of setting messed up. I appreciate the screenshot of it working.

0

Eric Neilsen wrote:

Ok, well I'm convinced that it works. I somehow must have some sort
of setting messed up.


I suspect the problem is that the editor font you are using
('Monospaced' - whatever that eventually maps to) simply doesn't have
glyphs for the japanese characters you're using. I got the font I'm
using here:

http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/

I appreciate the screenshot of it working.


You're welcome. Let me know if you want to check other settings/config
files.

Regards,
Edwin

0

Fonts in editor are controlled by different setting rather all other fonts. So you're to modify Settings|Colors&Fonts rather Settings|Appearance.

0

I've update to build 6083 and it works now. If anyone else has had the same problem as me they should try updating and seeing if that fixes it for them.

0

Please sign in to leave a comment.