diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-24 02:33:22 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-24 02:33:22 +0000 |
commit | 361504f357e6882891f56aaf84dfa521a87f8739 (patch) | |
tree | eec77fc4990d6b183833117abb407eacf5ea88ef /chrome/third_party | |
parent | 3453068e7facd042b827a011a56ee516409fa07b (diff) | |
download | chromium_src-361504f357e6882891f56aaf84dfa521a87f8739.zip chromium_src-361504f357e6882891f56aaf84dfa521a87f8739.tar.gz chromium_src-361504f357e6882891f56aaf84dfa521a87f8739.tar.bz2 |
Fix Issue 1356872 "Russian bdic is corrupted".
The AffReader::AddAffix() function does not reencode a "stripping prefix (or
suffix)" field of a PFX (or SFX) line.
Unfortunately, this function creates corrupted prefix (and suffix) rules for
some dictionaries whose encoding is not UTF-8 (e.g. Russian, Polish, etc.)
because a "stripping prefix (or suffix)" field isn't only a length of a prefix
(or suffix) but also it is a string to be replaced.
To solve this problem, this change branch checks the third token of an PFX (and
SFX) line represents a "stripping characters" field or a "cross product" field,
and reencode them only if the third token represents a suffix or a prefix.
Needless to say, we also have to re-create bdics and push them to our download
server to solve this issue. :)
BUG=1428
Review URL: http://codereview.chromium.org/3183
Review URL: http://codereview.chromium.org/3183
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/third_party')
-rw-r--r-- | chrome/third_party/hunspell/google/bdict.h | 4 | ||||
-rw-r--r-- | chrome/third_party/hunspell/google/bdict_writer.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/chrome/third_party/hunspell/google/bdict.h b/chrome/third_party/hunspell/google/bdict.h index b96a2e4..3157616 100644 --- a/chrome/third_party/hunspell/google/bdict.h +++ b/chrome/third_party/hunspell/google/bdict.h @@ -98,6 +98,10 @@ class BDict { public: // File header. enum { SIGNATURE = 0x63694442 }; + enum { + MAJOR_VERSION = 1, + MINOR_VERSION = 1 + }; struct Header { uint32 signature; diff --git a/chrome/third_party/hunspell/google/bdict_writer.cc b/chrome/third_party/hunspell/google/bdict_writer.cc index 67be677..fcb060d 100644 --- a/chrome/third_party/hunspell/google/bdict_writer.cc +++ b/chrome/third_party/hunspell/google/bdict_writer.cc @@ -451,8 +451,8 @@ std::string BDictWriter::GetBDict() const { hunspell::BDict::Header* header = reinterpret_cast<hunspell::BDict::Header*>(&ret[0]); header->signature = hunspell::BDict::SIGNATURE; - header->major_version = 1; - header->minor_version = 0; + header->major_version = hunspell::BDict::MAJOR_VERSION; + header->minor_version = hunspell::BDict::MINOR_VERSION; header->aff_offset = static_cast<uint32>(aff_offset); header->dic_offset = static_cast<uint32>(dic_offset); |