在我遇到精灵线程的问题时,遇到一个中文路径的问题

原来是这样的

URL url=Test8.class.getClassLoader().getResource("");

String dir=url.getFile();

出现了中文乱码

解决方案:

String dir=Test8.class.getResource("").toURI().getPath();

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-17
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-11-16
  • 2021-08-27
相关资源
相似解决方案