AndrolibResources +isPrintableChar()

This commit is contained in:
Ryszard Wiśniewski 2011-05-03 16:57:40 +02:00
parent f041f091c5
commit 501a92d733

View File

@ -27,6 +27,7 @@ import brut.androlib.res.util.*;
import brut.common.BrutException; import brut.common.BrutException;
import brut.directory.*; import brut.directory.*;
import brut.util.*; import brut.util.*;
import java.awt.event.KeyEvent;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -563,6 +564,14 @@ final public class AndrolibResources {
return out.toString(); 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. // TODO: dirty static hack. I have to refactor decoding mechanisms.
public static boolean sKeepBroken = false; public static boolean sKeepBroken = false;