cloudflare / py-mmdb-encoder

Create mmdb files to encode prefix lists.
BSD 3-Clause "New" or "Revised" License
30 stars 11 forks source link

Problems with Sonderzeichen - like ö, ä and others #7

Open swontroba opened 4 years ago

swontroba commented 4 years ago

In TYPE_UTF8STR it would be helpful to have some utf-8 encoding and then work with the length of the encoded value. With this we are able to use other utf-8 encodes characters.

Please change so others can also use utf-8 characters.

if fieldid == EncoderConstants.TYPE_UTF8STR:               
    encoded_value = value.encode('utf-8')
    content = encoded_value
    length = len(encoded_value)