Skip to content

Instantly share code, notes, and snippets.

@nobusue
Created July 21, 2014 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nobusue/f75979ea367d518c185d to your computer and use it in GitHub Desktop.
Save nobusue/f75979ea367d518c185d to your computer and use it in GitHub Desktop.
Gradleでのnative2asciiの代替(不完全版)
/* 行末に特定の日本語文字があると文字化けしてしまう・・残念 */
import org.apache.tools.ant.filters.EscapeUnicode
apply plugin: 'java'
processResources {
include '**/*.properties'
filter{ String line ->
//byte[] bytes = line.getBytes()
//bytes.each{ printf("%02x", it); print ' ' }; println ""
String newStr = new String(bytes, 'UTF-8')
//println newStr
return newStr
}
filter(EscapeUnicode)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment