English 中文(简体)
apache 共同配置图书馆:腐败财产档案
原标题:apache common configuration library: corrupted property file

我从客户那里获得了腐败的财产档案。 该档案经申请修改,以更新版本编号。 守则使用apachecommsposition。 在我测试后,图书馆似乎总是以正直-8859-1格式书写档案。

法典简化如下。 下面的法典写坏案的可能性如何?

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

import java.io.FileWriter;
import java.io.IOException;

public class TestConfig {

    public void editVersionInfo() throws ConfigurationException, IOException {

        String filename = "C:\temp\VersionProperties\Version.properties";
        PropertiesConfiguration config = new PropertiesConfiguration(filename);
        config.setProperty("application.version", "2011");
        config.save(new FileWriter(filename));

    }

    public static void main(String[] args) throws IOException, ConfigurationException {
        TestConfig tc = new TestConfig();
        tc.editVersionInfo();
    }
}

就在案件上,坏档案如下。 它不喜欢任何编码。 档案最初是带有钥匙和价值的普通财产档案,全部是英文(acii chars)。

F????Co?aR??m??E?3#?? = hu00BD5ju00B3u00E0u0096u001Du0081feu00BEou00A3u0001u00FEu00A4u00DEu0000u00FBi"u009C{u00FCu00D9u00E2?cu00F6u00FF%Bu00A47u00195u001EXvu0097/u00D7xu0099u000Eu00A2gIXu0014u0097]ku00882u0003u0014u0097u00BCu00C3u00AEu00B4u001Eu00B3Ru00E4u00DE&u0000u0016u009B"7u0085 "u00DCT*v u0092u0007u0091Au00BDu00ACl6~u0097u00C0u00B1u00D1u00EBu00FFu00A8u00F3u0001 u00BFu0006u001Fu009Cfku009Fu00C2u00D9L^_u0004J4u00AFu00D8u00DAWu00C4u00CDju00E3u0095u00D1+u00CE?u0004>Z]u00D7u000Bu0098u0016u0095u00ACu00F7u00E7u009ATFu0019f)u00A3u00A9u00DCu00ADu00ACtq5u0085u008E-u00A3oHu0000u00C2u0092u00B5u00F2u008AGu008F&u00F5u0017Hu0003!u0083u00B4u008AV=u00E0u00EDju00F0u00D0Ju00DBu00CCu00F2Ou00CEu00BEu00F0*4u0006y~u00C3u00B7"u000Bu00E4u00C0$>u00F3u00F2~u00CEu0097#u00BAcu00EC@u00B4u00ADu009Au00BAXfFu0083]u00C2u00D4u00ABu00F3u009DQu0092u00854zu0097u00FDG u0095u00E3}tyu0082Iu00C3`u009E ??

Edit: The customer environment is japanese. How ever the application is always run with -Dfile.encoding=UTF8

问题回答

我怀疑你的客户有不同的违约性质,这符合你的情况。 检查这些财产的设定情况:file.encoding (现称,我知道)。

另一种可能性是,你有两条手写的该财产档案。 我不知道,但我怀疑阿帕奇图书馆因违约而赢得 t。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签