Quantcast

subclassing Console : looks like a bug!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

subclassing Console : looks like a bug!

frenchy48
if you write a very simple subClass of groovy.ui.Console
the output has then a very Strange behavior:
- if you create a String with "unusual" chars  (I mean chinese or Arabic )
- if you "println" this string then you only get "?????"
-but when printing the result it's ok

very annoying for me (because I need chinese and arabic chars!)
test example:
import groovy.ui.Console
class DummyConsole  extends Console{
    public DummyConsole(ClassLoader loader, Binding binding ) {
        super(loader, binding)
    }

    public static void main(String[] args) {
        def console = new DummyConsole(DummyConsole.class.classLoader?.getRootLoader(), new Binding())
        console.run()
    }
}

now run this:
str = "風 革 骨 鬼 韭"
println str
str

member of Grumpy Old Programmers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: subclassing Console : looks like a bug!

frenchy48
not a bug: a strange thing that happens when the code is started from inside IntelliJ
(was confused because tested subclass of Console inside IntelliJ)

sorry
member of Grumpy Old Programmers
Loading...