DataMelt forums

Full Version: Support UTF-8 ??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can this software support to you utf-8 ?

I use:
from org.python.core import codecs
codecs.setDefaultEncoding('utf-8')

and can't correct display Chinese(utf-8)
and went I edit a .py file in the build-in txt editor,
can type chinese...just become the garble words.
Any one can help?
Will this tool support unicode and UTF-8 input & output??

thanks,
Hello,

Can you try to write a script, and run it as "dmelt_batch.sh"? This works for my example:

Put this to the file "file.py"

a = [0xE3, 0x81, 0x82]
print "".join([chr© for c in a]).decode('UTF-8')


Run it as "dmelt_batch.sh file.py". It prints: あ

Indeed, Jython shell in DMelt IDE does not support UTF-8.
But I'm quite sure Java IO can support Chinese characters:

Try this example inside DMelt:

s = "现在进入";
from java.lang import System
System.out.println(s)

(the output will go to System console)

best, Tania
Dear Tania,

Thank you for your respond, hope that next version DMelt IDE can support it.

BR,

(02-23-2016 01:32 PM)admin Wrote: [ -> ]Hello,

Can you try to write a script, and run it as "dmelt_batch.sh"? This works for my example:

Put this to the file "file.py"

a = [0xE3, 0x81, 0x82]
print "".join([chr© for c in a]).decode('UTF-8')


Run it as "dmelt_batch.sh file.py". It prints: あ

Indeed, Jython shell in DMelt IDE does not support UTF-8.
But I'm quite sure Java IO can support Chinese characters:

Try this example inside DMelt:

s = "现在进入";
from java.lang import System
System.out.println(s)

(the output will go to System console)

best, Tania
Reference URL's