File.listFiles() mangles unicode names with JDK 6 (Unicode Normalization issues)

前端 未结 6 1068
故里飘歌
故里飘歌 2020-11-30 02:24

I\'m struggling with a strange file name encoding issue when listing directory contents in Java 6 on both OS X and Linux: the File.listFiles() and related metho

6条回答
  •  清歌不尽
    2020-11-30 02:49

    I've seen something similar before. People that uploadde files from their Mac to a webapp used filenames with é.

    a) In OS that char is normal e + "sign for ´ applied to the previous char"

    b) In Windows it's a special char: é

    Both are Unicode. So... I understand you pass the (b) option to File create and at some point Mac OS converts it to the (a) option. Maybe if you find the double representation issue over the internet you can get a way to handle both situations successfully.

    Hope it helps!

提交回复
热议问题