Java Can't Open a File with Surrogate Unicode Values in the Filename?

前端 未结 4 592
一整个雨季
一整个雨季 2020-12-03 17:54

I\'m dealing with code that does various IO operations with files, and I want to make it able to deal with international filenames. I\'m working on a Mac with Java 1.5, and

4条回答
  •  半阙折子戏
    2020-12-03 18:24

    If your environment's default locale does not include those characters you cannot open the file.

    See: File.exists() fails with unicode characters in name

    Edit: Alright.. What you need is to change the system locale. Whatever OS you are using.

    Edit:

    See: How can I open files containing accents in Java?

    See: JFileChooser on Mac cannot see files named by Chinese chars?

提交回复
热议问题