diff options
author | Tor Norbye <tnorbye@google.com> | 2012-08-02 08:25:32 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-08-03 19:07:51 -0700 |
commit | 2fb2655ff72c6cf7f6cb0ac7e933304a5a1298e0 (patch) | |
tree | f3c0ea2686be79ddffc21097f6928bebf61fe30e /lint/cli | |
parent | 384cf815c32a864267dae339e23108379d4ab957 (diff) | |
download | sdk-2fb2655ff72c6cf7f6cb0ac7e933304a5a1298e0.zip sdk-2fb2655ff72c6cf7f6cb0ac7e933304a5a1298e0.tar.gz sdk-2fb2655ff72c6cf7f6cb0ac7e933304a5a1298e0.tar.bz2 |
Add support for additional languages in the typo detector
This checkin adds typo databases for six additional languages, as well
as several fixes to the infrastructure.
First, it now supports "globbing", since for example the German typo
database contains glob patterns of the form
"asymetrisch*->asymmetrisch*".
Second, it supports multiword typos (such as "all zu->allzu") which
caused some complications (since this means that the typo detector
can match beyond the word boundary it was passed in).
Third, it adds a bunch of validation code to the type dictionaries,
which uncovered a bunch of inconsistencies (duplicate entries, using
"-" instead of "->" for some separators, etc). There's now a unit test
which produces a cleaned up version of each dictionary file, as well
as tests to ensure that the ASCII and the UTF-8 comparison methods are
in sync (and this uncovered some bugs which were fixed.)
Finally, it fixes the HTML reporter such that it properly handles
UTF-8.
Change-Id: Ie32cbbe489687a7b50184696a027f87c2e21c409
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/HtmlReporter.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lint/cli/src/com/android/tools/lint/HtmlReporter.java b/lint/cli/src/com/android/tools/lint/HtmlReporter.java index e962fec..c3ed9d2 100644 --- a/lint/cli/src/com/android/tools/lint/HtmlReporter.java +++ b/lint/cli/src/com/android/tools/lint/HtmlReporter.java @@ -33,10 +33,10 @@ import com.google.common.base.Charsets; import com.google.common.collect.Maps; import com.google.common.io.ByteStreams; import com.google.common.io.Closeables; +import com.google.common.io.Files; import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.Writer; @@ -86,7 +86,7 @@ public class HtmlReporter extends Reporter { */ public HtmlReporter(Main client, File output) throws IOException { super(client, output); - mWriter = new BufferedWriter(new FileWriter(output)); + mWriter = new BufferedWriter(Files.newWriter(output, Charsets.UTF_8)); } @Override @@ -96,6 +96,7 @@ public class HtmlReporter extends Reporter { mWriter.write( "<html>\n" + //$NON-NLS-1$ "<head>\n" + //$NON-NLS-1$ + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>" + //$NON-NLS-1$ "<title>" + mTitle + "</title>\n"); //$NON-NLS-1$//$NON-NLS-2$ writeStyleSheet(); |