In my Bundle, I'm trying to display utf-8 characters, I suppose my default charset is Cp1250 and strange behaviour happens:
public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
System.out.println("ąśżłóę"); // this is what should've been displayed
System.out.println("������"); // this is the utf8 above encoded to cp1250
}
public void stop(BundleContext context) throws Exception {
}
public static void main(String args[]){
System.out.println("ąśżłóę"); //utf-8
System.out.println("������"); //cp1250
}
}
Output when I run main, I get what I expected:
ąśżłóę
ąśżłóę
Output when I start a Bundle from an OSGi Framework, characters are encoded from utf-8 to cp1250. So the output is exactly opposite.
ąśżłóę
ąęźł
So my question is: how to deal with it? Should I write an application in cp1250 instead of utf-8? Or is it possible to change osgi default charset?