2017-06-25 19 views
0

搖籃逃生資源包的.propertiesgradle這個資源包屬性EscapeUnicode:不工作

import org.apache.tools.ant.filters.EscapeUnicode 

processResources { 
    from '/path/resources' 
    include '*.properties' 
    filter (EscapeUnicode) 
} 

轉義proeprties文件是不正確的。屬性文件採用UTF-8編碼。需要指定

編碼= 「UTF-8」

?如何爲過濾器指定編碼?

回答

1

您之後的房產是filteringCharset。它定義了使用過濾器時文件的編碼。如果沒有此設置,系統將使用默認編碼,因此在使用過濾器時應始終指定它。

processResources { 
    filteringCharset 'UTF-8' 
} 
相關問題