Java File Name Encode fileNameEncode(String fileName)

Here you can find the source of fileNameEncode(String fileName)

Description

file Name Encode

License

Open Source License

Declaration

public static String fileNameEncode(String fileName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String fileNameEncode(String fileName) {

        if (fileName == null)
            return null;
        try {//from   www . j a  va  2  s  .c  om
            return new String(fileName.getBytes("gbk"), "ISO-8859-1");
        } catch (Exception ex) {
            return fileName;
        }
    }
}

Related

  1. fileNameEncode(String str)
  2. filenameEncode(String string)