Home > Back-end >  Eclipse opened the local music, music is garbled
Eclipse opened the local music, music is garbled

Time:09-19

In eclipse wrote a music player, when open the local music, as long as the music name is in Chinese, after opening is garbled! To solve!

CodePudding user response:

Usually this is coding problem set utf-8 didn't look at your code

CodePudding user response:

reference 1st floor usecf response:
this is general coding problem set utf-8 didn't look at your code

Set up or not

CodePudding user response:

What is your system environment

Mp3 file name is GBK under Windows

CodePudding user response:

The
reference tianfang reply: 3/f
what is your system environment

Mp3 file name under the Windows is GBK

My system is Windows, is that in eclipse to change the form of GBK encoding format? Can you say about how the detail? Thank you very much!

CodePudding user response:

Not asking project is GBK, is to read the file name, should be handled in accordance with GBK string

CodePudding user response:

The
reference 5 floor tianfang reply:
not asking project is GBK, is to read the file name, should be handled in accordance with GBK string

How to set up, please? Thank you very much!

CodePudding user response:

https://blog.csdn.net/youyou1543724847/article/details/83956381

The third question

CodePudding user response:

refer to 7th floor tianfang response:

https://blog.csdn.net/youyou1543724847/article/details/83956381
The third question

Still won't do, is to use Java to write their own music in the music player to open the local files, music is garbled, below is part of the code
The File File=new File (filepath + selectedSongName);
AudioInputStream=AudioSystem. GetAudioInputStream (file);
AudioFormat=audioInputStream. GetFormat ();
DataLine. Info dataLineInfo=new DataLine. Info (SourceDataLine. Class, audioFormat);
SourceDataLine=(sourceDataLine) AudioSystem. GetLine (dataLineInfo);
SourceDataLine. Open (audioFormat);
SourceDataLine. Start ();

CodePudding user response:

The same problem, the problem of the encoding of the string

You learn from this, write a automatic identification coding method

https://blog.csdn.net/bigKylin/article/details/72413474

CodePudding user response:

references 9 f tianfang response:
the same problem, the encoding of the string problems

You learn from this, write a automatic identification coding method

https://blog.csdn.net/bigKylin/article/details/72413474

Thank you very much for your patience to solve!
  • Related