From 501a92d733e94f831f56a16926a6c6f8876cb2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Tue, 3 May 2011 16:57:40 +0200 Subject: [PATCH] AndrolibResources +isPrintableChar() --- .../main/java/brut/androlib/res/AndrolibResources.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java b/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java index 526f98fd..d49ebf8f 100644 --- a/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java +++ b/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java @@ -27,6 +27,7 @@ import brut.androlib.res.util.*; import brut.common.BrutException; import brut.directory.*; import brut.util.*; +import java.awt.event.KeyEvent; import java.io.*; import java.util.*; import java.util.logging.Logger; @@ -563,6 +564,14 @@ final public class AndrolibResources { return out.toString(); } + public static boolean isPrintableChar(char c) { + Character.UnicodeBlock block = Character.UnicodeBlock.of(c); + return ! Character.isISOControl(c) + && c != KeyEvent.CHAR_UNDEFINED + && block != null + && block != Character.UnicodeBlock.SPECIALS; + } + // TODO: dirty static hack. I have to refactor decoding mechanisms. public static boolean sKeepBroken = false;