Refactor getCodepoint() to more consistently handle return values

Change-Id: Ida90e6c78be41e8527eaefd14feb45c57413945e
Merge "Refactor getCodepoint() to more consistently handle return values"