Prior to this bug fix, decoding a UTF-8 codepoint that was
encoded as 4 bytes would result in an incorrect value, and
could sometimes result in an arithmetic overflow exception.
This was the result of a copy-paste typo, using the wrong variable name.
This commit fixes that issue and also adds to the test cases
so that the 2-byte, 3-byte, and 4-byte paths are exercised during tests.
Prior to this bug fix, decoding a UTF-8 codepoint that was encoded as 4 bytes would result in an incorrect value, and could sometimes result in an arithmetic overflow exception.
This was the result of a copy-paste typo, using the wrong variable name.
This commit fixes that issue and also adds to the test cases so that the 2-byte, 3-byte, and 4-byte paths are exercised during tests.