Ant:propertyfile 任务中格式错误的 \uxxxx 编码 [英] Ant: Malformed \uxxxx encoding in propertyfile task
问题描述
我编写的 Ant 脚本出现以下错误.
I get the error below with an Ant skript I wrote.
我已经做了一些谷歌搜索,发现问题在于包含 \u 的字符串,这在 Windows 下发生,因为目录分隔符.我将所有这些更改为/但错误仍然存在.
I already did some googling and found out, that the problem lies with strings containing \u, which happens under Windows because of the directory separator. I changed all those to / but the error remains.
我的脚本中肯定没有剩余的 \u 字符串.
There are definitely no remaining \u strings in my script.
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
执行propertyfile 任务时出现错误,所以我检查了我要更改的文件.另一方面,这包含多个 \u 字符串.该文件虽然与 ant 无关,但它是一个 borland 项目文件 (xml),其中包含一行,如 [someParameter]=[someValue].
The error occurs when executing the propertyfile task, so I examined the file I want to change. This on the other hand contains multiple \u strings. The file has no relation to ant though, it's a borland project file (xml) which contains one line like [someParameter]=[someValue].
我只想将 [someValue] 增加 1.
I just want to increase [someValue] by 1.
所以我的问题是:
我要更改的属性文件是否会导致提到的错误
Can the property file I want to change cause the error mentioned
如果答案是是",
我能做什么,除了用正则表达式任务来做(比如找到线,propertyregex-ing值,数学+1值和regex-replaceing值)
What can I do, other than doing it with a regex task (like finding the line, propertyregex-ing the value, math+1 the value and regex-replacing the value)
推荐答案
我知道这个问题很久以前就有人问过了,但我在没有答案的情况下偶然发现了它,在我发现的另一个网站上 (http://www.coderanch.com/t/107014/tools/Malformed-uxxxx-encoding-error) 我发现这可能发生在文件目的地使用/"而不是\"时,因为解析的工作方式/希望这会有所帮助.
i know that this question was asked a while ago but i stumbled on it without an answer, on another site i found (http://www.coderanch.com/t/107014/tools/Malformed-uxxxx-encoding-error) i found that this could happen when instead of "\" for file destinations you should be using "/" because of how parsing works/ Hope this helps.
这篇关于Ant:propertyfile 任务中格式错误的 \uxxxx 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!