A TIFF tag defined as ASCII, is by the specification only allowed to contain plain 7 bit ASCII.
Unfortunately, this isn't very useful in the real world (where not all of us speak English), so a lot of software will write UTF8
or even a ISO-8859-x
encoded strings into these fields, even if it's in violation of the spec. There is no other encoding allowed in an ASCII tag.
JAI, being very strict in reading, probably decodes the string as plain ASCII, and as the 'é' isn't part of that charset it replaces it with a "unicode replacement char".
Your best bet, is to do one of the following:
- If allowed by the tag, use BYTE or UNDEFINED instead of ASCII + encoding specification
- If possible, use a different tag to write your value (that allows BYTE or UNDEFINED values + encoding specification)
- If neither of the above is possible, your best bet is to get to the actual bytes and decode yourself, or use a different library to parse the TIFF structure