Add AWS Region support to PhutilAWSFuture.

Summary:
Almost [[http://docs.aws.amazon.com/general/latest/gr/rande.html|all]] AWS services endpoints follow this structure: `SERVICE_NAME.REGION_ID.amazonaws.com`. This revision adds support for setting a region in `PhutilAWSFuture`.

There are couple of exceptions to above rule - some services do not have region in their endpoint url (DevPay, Route 53, IAM, Import/Export, Security Token Service), some have a single endpoint in one region (OpsWorks, Support), some are //funky// (S3), but they all can be covered by overriding `getHost()` method.

Test Plan: No tests added. I `ack`ed through three repositories (`libphutil`, `arcanist` & `phabricator`) and couldn't find AWS used anywhere.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D8311
Add phutil_is_utf8_with_only_bmp_characters()

Summary:
Ref T1191. We currently use `utf8` charsets in MySQL, which silently truncate characters outside of the basic multilingual plane (larger than U+FFFF) like "Musical G-Clef".

Add a method to detect that a string contains characters outside of this range, and thus that inserting it will silently truncate data.

Test Plan: Added and executed unit tests.

Reviewers: btrahan, arice

Reviewed By: arice

CC: chad, arice, aran

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D8310
Implement phutil_is_utf8_with_only_bmp_characters() without segfaulting

Summary: See comments. The regexp based implementation segfaults unpreventably on small inputs. Do it nice and slow in PHP instead.

Test Plan: Ran unit tests.

Reviewers: btrahan, arice

Reviewed By: arice

CC: chad, arice, aran

Differential Revision: https://secure.phabricator.com/D8312
Reject nonminmal representations of UTF8 at the beginning of the 3-byte BMP range

Summary: Ref T1191. These byte ranges (\xE0\x80\x80 through \xE0\x9F\xBF) are alternate representations of characters with a different preferred minimal representation. MySQL and mbstring both reject them, and we should too.

Test Plan: Ran unit tests.

Reviewers: btrahan, arice

Reviewed By: arice

CC: chad, arice, aran

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D8313
Change "%s" in qsprintf to exclude non-BMP characters

Summary:
Ref T1191. Make `%s` in qsprintf reject non-BMP characters. Introduce `%B` for escaping binary strings.

Basically, this just makes "yes, I want to put binary data in this column" explicit.

Test Plan: See next diff for test coverage in Phabricator.

Reviewers: btrahan, arice

Reviewed By: arice

CC: chad, arice, aran

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D8315
Remove "supportsStateParameter()" from generic OAuth2 code

Summary:
Depends on D8318. All providers must support this, or they can't be implemented securely. This is based on a very old reading of the GitHub instructions or something like that which didn't mention "state", but the provider supports it.

This has no impact at runtime because no provider has ever returned `false` from this method, nor would we ever implement a provider that did.

Test Plan: Grepped for callsites.

Reviewers: btrahan, arice

Reviewed By: arice

CC: chad, arice, aran

Differential Revision: https://secure.phabricator.com/D8319