objective-git icon indicating copy to clipboard operation
objective-git copied to clipboard

GTSignature does not support non-UTF8 name or email

Open jspahrsummers opened this issue 12 years ago • 4 comments

Related to #195, we assume that the author name and email are UTF-8, which results in nil when they're actually not.

Maybe we should use a more lenient encoding for all our strings, or at least figure out how git determines the encoding to use.

jspahrsummers avatar Jul 05 '13 21:07 jspahrsummers

Just a note because I scoured the intarwebz about that : I'm not aware of any Cocoa-level API on NSString that can do this, but I found this in Carbon-land. Maybe I'll whip up a category sometime ;-).

tiennou avatar Jul 14 '13 19:07 tiennou

@tiennou NSString has a few methods related to encoding, but CFString has many more. That's probably where you can find any Carbon equivalents.

jspahrsummers avatar Jul 15 '13 18:07 jspahrsummers

I'm afraid to report I have checked those (obvious places ;-)). And the methods there don't guess encodings, they either rely on underlying data — only the NSURL/CFURL ones do have a pointer to the used CFStringEncoding because HTTP provided one — or convert an already built string into another encoding. Ye old Carbon way it is :-(.

tiennou avatar Jul 15 '13 18:07 tiennou

Ehhhhh. I'd lean more toward just trying a bunch of encodings in succession, ending with one that absolutely won't fail (like non-strict ASCII).

jspahrsummers avatar Jul 15 '13 18:07 jspahrsummers