Challenge to deal with garbled characters with Java AudioSystem.getMixerInfo ()

Garbled characters occur in Java AudioSystem.getMixerInfo ()

It seems to be a Java bug, so I can't completely deal with it, but I tried to display it for the time being.

Bug information ... Not addressed?

Since it was not acquired normally due to the influence of the bug, the first byte "-125" of the 2-byte character code is entered at the end. Forcibly convert to space.

Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo() ;
for (int i = 0; i < mixerInfo.length; i++){
  byte b[] =  mixerInfo[i].getName().getBytes( java.nio.charset.StandardCharsets.ISO_8859_1 );
  if( b[b.length -1 ] == -125 ){ b[b.length -1 ] = 0x20 ; }
  String l = new String( b );
  system.out.println( l );

For the time being, just eliminate the garbled characters! !!

Execution result

?v???C?}?? ? ?X?s?[?J?[ (Realtek High Definition A ?v???C?}?? ?T?E? ?X?e???I ?~?L?T?[ (Realtek Hig Port ?X?s?[?J?[ (Realtek High D Port ?X?e???I ?~?L?T?[ (Rea

Execution result (before space conversion)

primary ? Speaker (Realtek High Definition A Primary Sau? Stereo mixer (Realtek Hig Port Speaker (Realtek High D Port Stereo Mixer (Rea

Execution result (after space conversion)

primary Speaker (Realtek High Definition A Primary Sau Stereo mixer (Realtek Hig Port Speaker (Realtek High D Port Stereo Mixer (Rea

Recommended Posts

Challenge to deal with garbled characters with Java AudioSystem.getMixerInfo ()
Dare to challenge Kaggle with Java (1)
Java to play with Function
Connect to DB with Java
Connect to MySQL 8 with Java
Zip compression with Java in Windows environment without garbled characters
Java to learn with ramen [Part 1]
[Java] Points to note with Arrays.asList ()
I tried to interact with Java
Java, arrays to start with beginners
A story that I struggled to challenge a competition professional with Java
How to fix garbled Japanese characters in JAVA (including Arduino IDE)
Android: How to deal with "Could not determine java version from '10 .0.1'"
Project facet Java version 13 is not supported. How to deal with
How to compile Java with VsCode & Ant
[Java] How to compare with equals method
[Android] How to deal with dark themes
Introduction to algorithms with java --Search (depth-first search)
Java String Byte string truncation Supports garbled characters
Easy to trip with Java regular expressions
How to deal with Precompiling assets failed.
Java8 / 9 Beginners: Stream API addiction points and how to deal with them
Introduction to algorithms with java --Search (breadth-first search)
It's a pain to deal with old dates
[Java] How to test for null with JUnit
I tried to make Basic authentication with Java
Introduction to algorithms with java --Search (bit full search)
Deploy Java web app to Azure with maven
Try to link Ruby and Java with Dapr
How to use Java framework with AWS Lambda! ??
I want to use java8 forEach with index
How to use Java API with lambda expression
Getting started with Kotlin to send to Java developers
Try to implement TCP / IP + NIO with JAVA
[Java] Article to add validation with Spring Boot 2.3.1.
Easy to make LINE BOT with Java Servlet
I tried to break a block with java (1)
[Java] Introduction to Java
Introduction to java
Umlaut garbled characters
[Java] Align characters even with mixed half-width and full-width characters
How to call functions in bulk with Java reflection
List processing to understand with pictures --java8 stream / javaslang-
Measures against garbled characters in Multipart Request with Quarkus
Submit a job to AWS Batch with Java (Eclipse)
Diet program with preprocessor (how to deal with i-appli size)
I tried to implement TCP / IP + BIO with JAVA
How to deal with fatal: remote origin already exists.
[Java 11] I tried to execute Java without compiling with javac
[Java] How to omit spring constructor injection with Lombok
How to deploy Java to AWS Lambda with Serverless Framework
How to deal with No template for interactive request
[Java] How to encrypt with AES encryption with standard library
[Docker environment] How to deal with ActiveSupport :: MessageEncryptor :: InvalidMessage
[Java] Refer to and set private variables with reflection
[Rails] How to deal with URL changes after render
Display characters on I2C 1602 LCD with Raspberry Pi 3 & Java
HTTPS connection with Java to the self-signed certificate server
I tried to implement Stalin sort with Java Collector
I want to transition screens with kotlin and java!
Try connecting to AzureCosmosDB Emulator for Docker with Java