Bug 1055102 - Properly handle Unicode in Bagheera payloads; r=bsmedberg

It was observed that FHR was sending invalid JSON payloads to the
server. Specifically, JSON payloads contained invalid Unicode strings.

Investigation revealed that the culprint was CommonUtils.convertString()
silently swallowing high bytes. When the Bagheera client went to gzip
the JSON payload, the input buffer into gzip was missing high bytes.

This patch changes the bagheera client to UTF-8 encode strings before
gzip, thus ensuring all data is preserved. A corresponding change was
also added to the mock bagheera server implementation.

Alternatively, we could have changed CommonUtils.convertString() to
be high byte aware. However, many consumers rely on this function.
This patch is written with the intent of being uplifted and the change
performed is targeted at the specific problem.

Tests for Unicode preserving behavior have been added to both the
generic Bagheera client and to FHR. The latter test is arguably
not necessary, but peace of mind is a good thing, especially with
FHR.

See also bug 915850.

--HG--
extra : rebase_source : 4efddea7767c2e5f8cf19df247c3aba07c40eec6
extra : amend_source : ae3b6d89efa54fc9ed1794404476622946ad4b22
Bug 1041917 - Make it possible to transition from non-remote to remote browsers while browsing away from about: pages. r=billm. feedback=mrbkap.

--HG--
extra : histedit_source : f6bc00b11d21d68cc1a09c5da70d81a1c054085e
Bug 1055338 - Init pageactions on first use. r=mfinkle
Bug 1011470 - Remove panel picker logic. r=liuche
Bug 1007523 - Add UI telemetry for managing search engines. r=liuche
Bug 1043027 - Only show clear button when there is text in the search bar. r=eedens
Bug 1053208 - Settings button should look like a settings button. r=margaret
Bug 1048418 - Paint flashing localizations need more space for text, gets cropped/truncated. r=liuche
Bug 1052026 - Add content description when creating action button in GeckoActionProvider. r=wesj
Bug 1055333 - Enable currently passing devtools/styleeditor tests with e10s. r=harth
Bug 1055747 - Fix Loop UI showcase for Chrome to avoid visual regressions, r=andrei.br92@gmail.com
Merge m-c to fx-team. a=merge
Bug 1052254 - Disable wyciwyg urls in guest mode. r=rnewman
Bug 1054537 - Change restoreLastSession to use Task.async. r=wesj
Bug 1054920 - Do not allow casting UI to appear if the video is an unsupported format r=wesj
Backed out changeset 80bf024e03d6 (bug 1054920) for robocop-5 and S4 orange
Merge m-c to fx-team a=merge
Merge latest green fx-team changeset and mozilla-central; a=merge