Ant:属性文件任务中的\ uxxxx编码格式错误 [英] Ant: Malformed \uxxxx encoding in propertyfile task
问题描述
我用我写的Ant skript收到以下错误.
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.
执行属性文件任务时发生错误,因此我检查了要更改的文件.另一方面,它包含多个\ 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
如果答案是是",
我能做些什么,除了使用正则表达式任务(例如查找行,对值进行正则表达式赋值,对值进行数学+1和对正则表达式进行替换)
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)
推荐答案
我知道这个问题是在不久前提出的,但是我在没有找到答案的情况下偶然发现了这个问题,在另一个发现的网站上(
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:属性文件任务中的\ uxxxx编码格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!