question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow EXIFReader to use other encodings than ASCII/UTF-8

See original GitHub issue

I try to read a bunch of old tiff files encoded on an old windows system. All ascii headers are encoded in “windows-1252”/“Cp1250” but EXIFReader doesn’t provide any ability to override the default encoding: UTF-8.

As far as I can see the issue is located in line 315 (Version 3.3.2):

return StringUtil.decode(ascii, 0, len, "UTF-8"); 

We could add two constructors to EXIFReader:

public EXIFReader() {
    this(Charset.forName("UTF-8"));
}
public EXIFReader(Charset charset) {
    this.charset = charset;
}

WDYT?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
haraldkcommented, Feb 1, 2021

No worries, I’ll continue to use UTF-8. 😀

– Harald K

0reactions
garretwilsoncommented, Feb 1, 2021

Java property files was defined to be ISO-8859-1 from the start, so using it as a fallback there is an obvious choice …

Ah, @haraldk , you make a good point. You’re right, there is less probability in this situation that ISO-8859-1 would be the correct eight-bit encoding. Java properties files as you noted were originally defined to use ISO-8859-1.

I guess my bigger fear was that you might switch to only supporting ASCII, so I’m glad that’s not the case. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choosing & applying a character encoding - W3C
Why use UTF-8? An HTML page can only be in one encoding. You cannot encode different parts of a document in different encodings....
Read more >
Character Encodings in Linux: ASCII, UTF-8 and ISO-8859
ISO/IEC 8859 sought to fix this problem by utilizing the eighth bit in an 8-bit byte to allow positions for another 96 printable...
Read more >
Unicode, UTF-8, and ASCII encodings made easy - Medium
First there was the C programming language, then there was ASCII. ... Different people would use different characters for the same numbers.
Read more >
Unicode, in friendly terms: ASCII, UTF-8, code ... - YouTube
Unicode and character encoding might seem like a tricky topic, ... To Store Characters Using ASCII 01:38 What About All The Other Languages?...
Read more >
exifreader - npm
Library that parses Exif metadata in images.. Latest version: 4.9.0, last published: 11 hours ago. Start using exifreader in your project by running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found