Support for non-ASCII charsets
thomasgassmann opened this issue · 2 comments
thomasgassmann commented
According to the spec, exif only supports ASCII.
2 = ASCII An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL.
Yet in practice, a lot of tools write UTF8 text into fields such as ImageDescription
.
My suggestion would be to optionally support different charsets when decoding exif type 2.
If that's a change you're willing to accept, I'd gladly submit a PR.
lovell commented
Hi, perhaps if non-ASCII is detected, i.e. the top-bit of any char is set, then we should return a Buffer
instead and let the caller decide how to decode.
If we do this, it would also make sense to expose the endianness (bigEndian
) as you'd need that to handle UTF-16.
lovell commented
v1.2.0