reworking the UNICODE_CHARACTERS section to more closely resemble the ruby version