Avoiding charset corruption when sending patches

Michael Stefaniuc mstefani at redhat.com
Wed Aug 20 06:21:53 CDT 2008


Hello Dan,

Dan Kegel wrote:
> Even longer story:
> 
> So, what character set is the Wine source tree encoded with?
> It looks like a mixture:
> 
> 1. in general, .c and .h files are encoded in Latin-1 aka iso8859-1.
> 
> 2. include/*.h are encoded in ASCII and are not allowed to have
> non-ascii chars; see http://bugs.winehq.org/show_bug.cgi?id=5420
> 
> 3. *_XX.rc (or XX.rc) are in the character set
> that Windows defaults to for language XX,
> unless changed by a #pragma code_page... in the .rc file.
> http://wiki.winehq.org/Developers-Hints#head-ef42a958e4f633dbd4a0ae42649fa02a4d1827fd
> 
> Which brings us to the question:
> since email clients love changing charsets of text messages,
> how can we avoid corrupting patches when sending them via email?
> It kind of looks like patches to .rc files
> must be attached rather than inline, and should
> be attached as .patch, .diff, or .bin files so they are
> marked with the mime type application/octet-stream
> which should inhibit all charset conversions.
> (Attaching as .txt might tempt mail clients to perform
> charset conversions on them.)
in the beginning I have tried to send my patches to the .rc files with
their native encoding. That doesn't work if you have a patch that spans
multiple language .rc files with different encodings. So I moved to tell
mutt to set the encoding to latin-1 but _not_ convert the encoding of
the text (mutt sucks at auto detecting the encoding and kept detecting
utf-8). Why latin-1? latin-1 is 8bit clean in regards to git; the patch
might look garbled in the mail client but git-am will apply the patch
just fine. For utf-8 git will check the patch if it really is valid
utf-8 and barf out if not.

bye
	michael

-- 
Michael Stefaniuc                           Tel.: +49-711-96437-199
Consulting Communications Engineer          Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach bei Muenchen
Handelsregister: Amtsgericht Muenchen HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
                 Werner Knoblich



More information about the wine-devel mailing list