When creating a file in java with a Russian name, a file with the name in the utf encoding is created. 8. How can I solve this problem?

  • Do you want the name to be in cp1251 encoding? - andrybak
  • The coding of the axis lying under the JVM cp1251, but when creating a file, the name of the file in the utf-8 encoding is still the same. - Olga

1 answer 1

The file name must be recoded to the encoding of the axis lying under the JVM. The coding of the axis can be found through:

String osEncoding=System.getProperty("file.encoding"); 

Update In general, the JVM encoding is usually the same as the axis encoding, so file names must be reflected correctly. Here you have some specific settings of either the axis, or the JVM. In general, some kind of non-standard situation.