Index: chrome/browser/spellchecker/spelling_service_client.cc |
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc |
index a0c1381cbb9a0eb9254982a6e9b02948f5181254..69b65b5b32aaccc12af96076720325cc74a451c7 100644 |
--- a/chrome/browser/spellchecker/spelling_service_client.cc |
+++ b/chrome/browser/spellchecker/spelling_service_client.cc |
@@ -66,8 +66,16 @@ bool SpellingServiceClient::RequestTextCheck( |
&language_code, |
&country_code); |
+ // Replace typographical apostrophes with typewriter apostrophes, so that |
+ // server word breaker behaves correctly. |
+ base::string16 text_copy = text; |
+ for (base::char16& c : text_copy) { |
groby-ooo-7-16
2015/06/17 19:12:02
std::replace(text_copy.begin(), text_copy.end(), L
please use gerrit instead
2015/06/17 20:21:35
Ooh, I like.
|
+ if (c == L'\x2019') |
+ c = '\''; |
+ } |
+ |
// Format the JSON request to be sent to the Spelling service. |
- std::string encoded_text = base::GetQuotedJSONString(text); |
+ std::string encoded_text = base::GetQuotedJSONString(text_copy); |
static const char kSpellingRequest[] = |
"{" |