SpencerPark / IJava

A Jupyter kernel for executing Java code.
MIT License
1.09k stars 212 forks source link

Maybe incompatible with zh_cn locale #28

Closed tqjason closed 5 years ago

tqjason commented 6 years ago

My test enviroment :

but it throw exception in jupyter exception1

SpencerPark commented 6 years ago

I just gave this a try on a linux and it seems to be working fine, the error messages that were propagated from jshell displayed properly.

The only thing that might be different with windows is the default encoding. Could you try the following steps to see if that fixes the issue, and if it does I will try to get that default into the software so it doesn't require external configuration.

tqjason commented 6 years ago

It's working.

Thanks.

CSchoel commented 6 years ago

I would also be very happy, if this line was in the default kernel.json. I used the IJava-Kernel for a bridging course in programming in Germany. My students would regularly add german umlauts to variable names and then wonder why their program does not compile and does not even produce an error message.

SpencerPark commented 5 years ago

Hello @tqjason and @CSchoel, I believe this issue is fixed upstream now. Would either of you mind testing the kernel from master here and confirm?

The -Dfile.encoding=utf8 should no longer be necessary. I was able to execute

System.out.println("\u6F22漢字");
String 漢 = "test漢";
漢

I am not sure of what the characters are, just copied from wikipedia :) It used to cause the same issue originally referenced but that seems to be fixed now.

Thanks in advance!

CSchoel commented 5 years ago

Hey, I just compiled and tested the current version of the kernel. The following example code ran without errors:

int xö߀ = 7 + 4;
System.out.println("x = "+xö߀);

I also tested your Chinese example and it worked fine. I think the issue is resolved. Thank you very much. :smiley:

SpencerPark commented 5 years ago

Fantastic, thanks @CSchoel!