Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.9, encoding and mofiles. #6

Open
donncha opened this issue Aug 24, 2010 · 1 comment
Open

1.9, encoding and mofiles. #6

donncha opened this issue Aug 24, 2010 · 1 comment

Comments

@donncha
Copy link

donncha commented Aug 24, 2010

GetText::MOFile::InvalidFormat: Unknown signature "\xDE\x12\x04\x95"

In mofile.rb, MAGIC_LITTLE/BIG_ENDIAN is declared as a string, UTF-8 on my system, yet the .mo is opened as a binary, i.e: ASCII-8BIT, so the magic check in load_from_stream() fails.

Since the file encoding is correct, shouldn't we use force_encoding("ASCII-8BIT") on the MAGIC strings?

Apologies if I've missed something obvious but this encoding stuff is a PITA.

@theflow
Copy link

theflow commented Jan 7, 2011

I have the same issue and as far as I understand it, force_encoding seems like a viable solution for this.

375gnu pushed a commit to 375gnu/gettext that referenced this issue Aug 10, 2012
…ncluded one

refs mutoh#6

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684184

The case checked this test is reported by 375gnu,
and Francesco Poli (wintermute). Thanks!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants