diff options
author | Matt Garnes <matt@cyngn.com> | 2015-04-06 18:25:47 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-04-10 22:31:57 +0000 |
commit | 748753da0d3f16c750180566540980bc82ce750c (patch) | |
tree | 19220b6c9e392443296fbefd3d9fba0eb141fbc5 /src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java | |
parent | 3650ca2b315f16f1b66d59bdf836a446a97343df (diff) | |
download | android_packages_apps_CMFileManager-748753da0d3f16c750180566540980bc82ce750c.tar.gz android_packages_apps_CMFileManager-748753da0d3f16c750180566540980bc82ce750c.tar.bz2 android_packages_apps_CMFileManager-748753da0d3f16c750180566540980bc82ce750c.zip |
Detect text encoding with juniversalchardet.
- When opening files in the built in editor for display, detect the
encoding with juniversalchardet, so that the correct encoding will be
used.
- Use byte buffers to back ShellConsole instead of StringBuffers
Change-Id: I85fa567ef589a82f1c8604f1f215647376c31c9a
(cherry picked from commit 55c55835d3bd685dde542b4f5952ce401542ab84)
Diffstat (limited to 'src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java')
-rw-r--r-- | src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java b/src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java index 1659fa20..54e81315 100644 --- a/src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/shell/CompressCommand.java @@ -202,7 +202,8 @@ public class CompressCommand extends AsyncResultProgram implements CompressExecu * {@inheritDoc} */ @Override - public void onParsePartialResult(final String partialIn) { + public void onParsePartialResult(final byte[] in) { + String partialIn = new String(in); if (partialIn == null || partialIn.length() ==0) return; boolean endsWithNewLine = partialIn.endsWith("\n"); //$NON-NLS-1$ String[] lines = partialIn.split("\n"); //$NON-NLS-1$ @@ -240,7 +241,7 @@ public class CompressCommand extends AsyncResultProgram implements CompressExecu * {@inheritDoc} */ @Override - public void onParseErrorPartialResult(String partialErr) {/**NON BLOCK**/} + public void onParseErrorPartialResult(byte[] partialErr) {/**NON BLOCK**/} /** * {@inheritDoc} |