1

I have Russian Windows 7 with some devices named in Russian. If I get such device as a mixer via AudioSystem.getMixerInfo() I have Mixer.Info.getName() decoded to unicode wrongly.

Is it possible to control conversion or this is Java design bug?

UPDATE

Actually Java decodes from CP1252 to unicode while my default locale is CP1251. How to say it to use CP1251?

Dims
  • 47,675
  • 117
  • 331
  • 600

2 Answers2

2

Just see links below:
https://bugs.openjdk.java.net/browse/JDK-8177951
http://mail.openjdk.java.net/pipermail/sound-dev/2017-June/000564.html

So I'm working on fixing this bug, but it seems that nobody in Oracle responds me. I sent the patch to the assignee of the bug(it's posted by me and managed by the assignee), but he didn't reply me, may be somedays later. Hopefully this patch will be included in the first JDK9 release...

Charlie Jiang
  • 31
  • 1
  • 8
1

I have the same issue (in russian Windows 7). I think the only way to get device name in Russian is to convert it to a proper character set:

    for (Mixer.Info info : AudioSystem.getMixerInfo()) {
        System.out.println(new String(info.getName().getBytes("Windows-1252"), "Windows-1251"));
    }
synther
  • 316
  • 4
  • 10