Re: [PATCH 6/9] pretty: two phase conversion for non utf-8 commits

2012-09-23 Thread Robin Rosenberg

A few nitpicks

- Ursprungligt meddelande -
 Always assume format_commit_item() takes an utf-8 string for
 simplicity. If commit message is in non-utf8, or output encoding is
 not, then the commit is first converted to utf-8, processed, then
 output converted to output encoding.
 
 This of course only works with encodings that are compatible with
 Unicode.
Such as? Unicode was defined to encompass all knows encodings.

 -static size_t format_commit_one(struct strbuf *sb, const char
 *placeholder,
 +static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
 + const char *placeholder,
   void *context)
  {
   struct format_commit_context *c = context;

Which parameter does the comment apply to? I believe most conventions
nowadays include parameter documentation in the comment preceding
the function header.

[...]

 b/t/t6006/commit-msg.iso8859-1
 new file mode 100644
 index 000..f8fe808
 --- /dev/null
 +++ b/t/t6006/commit-msg.iso8859-1
 @@ -0,0 +1,5 @@
 +Test printing of complex bodies
 +
 +This commit message is much longer than the others,
 +and it will be encoded in iso8859-1. We should therefore
 +include an iso8859 character: �bueno!

8859-1 to be exact. Only three 8859 encoding has the
character.

-- robin
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/9] pretty: two phase conversion for non utf-8 commits

2012-09-23 Thread Nguyen Thai Ngoc Duy
On Sun, Sep 23, 2012 at 8:54 PM, Robin Rosenberg
robin.rosenb...@dewire.com wrote:
 This of course only works with encodings that are compatible with
 Unicode.
 Such as? Unicode was defined to encompass all knows encodings.

Just a precaution because I have never read Unicode standard (and it
keeps getting updated, hence incomplete)


 -static size_t format_commit_one(struct strbuf *sb, const char
 *placeholder,
 +static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
 + const char *placeholder,
   void *context)
  {
   struct format_commit_context *c = context;

 Which parameter does the comment apply to? I believe most conventions
 nowadays include parameter documentation in the comment preceding
 the function header.

Yeah. I should have followed that.

 b/t/t6006/commit-msg.iso8859-1
 new file mode 100644
 index 000..f8fe808
 --- /dev/null
 +++ b/t/t6006/commit-msg.iso8859-1
 @@ -0,0 +1,5 @@
 +Test printing of complex bodies
 +
 +This commit message is much longer than the others,
 +and it will be encoded in iso8859-1. We should therefore
 +include an iso8859 character: �bueno!

 8859-1 to be exact. Only three 8859 encoding has the
 character.

Yep. But i'll probably need a closer look at t6006. It seems there's a
few upside down exclamation (not sure what it's called) in UTF-8 in
that test. I'll fix the text too.
-- 
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html