Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Double Byte Characters in File Name



Say, I have a file in /somedir/ named as file跟我學.txt. When trying to locate this file, in a Java code, this way

File file = new File("/somedir/file跟我學.txt")

if(file.exists()) {
// do something
}

my do something is not reachable. What is the simplest way to get this portion of code working?

(Actually, I am reading the file name from a db table)