git and utf16

Peter Harris peter.harris at hummingbird.com
Wed Oct 22 09:14:04 PDT 2008


Jeremy Huddleston wrote:
> Does anyone know if there's a way I can tell git that a file is utf16
> text so it treats it more intelligently than a binary file?

You could try using .gitattributes to see if you could come up with
something that works. "git help gitattributes"

The first thing that springs to mind is a clean/smudge filter (using
iconv or similar) to actually store the file in UTF-8, and only keep it
in UTF-16 in the checkout, although that would require all users of
"Localizable.strings" to configure the filter to get a functional file.

I'm not sure how the below email was generated, but setting
.gitattributes to use an external diff command that groks UTF-16 may help.

Just setting the 'diff' attribute will tell git that the file is text,
but it may not be what you want (UTF-16 tends to be poorly readable when
interpreted as Latin-1).

Peter Harris

> Begin forwarded message:
> 
>> From: jeremyhu at kemper.freedesktop.org (Jeremy Huddleston)
>> Date: October 21, 2008 19:37:20 PDT
>> To: xorg-commit at lists.freedesktop.org
>> Subject: xserver: Branch 'xorg-server-1.4-apple'
>>
>> hw/xquartz/bundle/Resources/English.lproj/Localizable.strings |binary
>> 1 file changed
>>
>> New commits:
>> commit e9fe3f36d9529f00daeefa1379cdd6f01a88f410
>> Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
>> Date:   Tue Oct 21 19:36:48 2008 -0700
>>
>>    XQuartz: Added missing semicolons to Localizable.strings
>>
>> diff --git
>> a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
>> b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
>> index dc19fc9..fec942e 100644
>> Binary files
>> a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings and
>> b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ
>> _______________________________________________
>> xorg-commit mailing list
>> xorg-commit at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/xorg-commit
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg


-- 
     Hummingbird Connectivity - A Division of Open Text
Peter Harris                    http://connectivity.hummingbird.com
Research and Development        Phone: +1 905 762 6001
peter.harris at hummingbird.com    Toll Free: 1 877 359 4866



More information about the xorg mailing list