Refine character codepoint toggling code

 * Partially in response to a previous review.
 * See LT-13359.

Change-Id: Ie56a8bf92e968ce39588cb71aa0f79b1746f27ab