<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/utf8.c, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-04-03T16:25:29Z</updated>
<entry>
<title>Merge branch 'ks/rfc2047-one-char-at-a-time' into maint</title>
<updated>2013-04-03T16:25:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-03T16:25:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6658b9d6917d9888fa41702bf53393c57de0631'/>
<id>urn:sha1:e6658b9d6917d9888fa41702bf53393c57de0631</id>
<content type='text'>
When "format-patch" quoted a non-ascii strings on the header files,
it incorrectly applied rfc2047 and chopped a single character in the
middle of it.

* ks/rfc2047-one-char-at-a-time:
  format-patch: RFC 2047 says multi-octet character may not be split
</content>
</entry>
<entry>
<title>Merge branch 'jk/utf-8-can-be-spelled-differently' into maint</title>
<updated>2013-03-26T19:43:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-03-26T19:43:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7cccbb3bb706b6a9eb13120e354a8487b4b3cfe'/>
<id>urn:sha1:d7cccbb3bb706b6a9eb13120e354a8487b4b3cfe</id>
<content type='text'>
Some platforms and users spell UTF-8 differently; retry with the
most official "UTF-8" when the system does not understand the
user-supplied encoding name that are the common alternative
spellings of UTF-8.

* jk/utf-8-can-be-spelled-differently:
  utf8: accept alternate spellings of UTF-8
</content>
</entry>
<entry>
<title>format-patch: RFC 2047 says multi-octet character may not be split</title>
<updated>2013-03-09T19:11:19Z</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@mns.spb.ru</email>
</author>
<published>2013-03-07T10:55:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6cd3c0532772749bcf6c4688f34c8ecc65ecb655'/>
<id>urn:sha1:6cd3c0532772749bcf6c4688f34c8ecc65ecb655</id>
<content type='text'>
Even though an earlier attempt (bafc478..41dd00bad) cleaned
up RFC 2047 encoding, pretty.c::add_rfc2047() still decides
where to split the output line by going through the input
one byte at a time, and potentially splits a character in
the middle.  A subject line may end up showing like this:

     ".... fö?? bar".   (instead of  ".... föö bar".)

if split incorrectly.

RFC 2047, section 5 (3) explicitly forbids such beaviour

    Each 'encoded-word' MUST represent an integral number of
    characters.  A multi-octet character may not be split across
    adjacent 'encoded- word's.

that means that e.g. for

    Subject: .... föö bar

encoding

    Subject: =?UTF-8?q?....=20f=C3=B6=C3=B6?=
     =?UTF-8?q?=20bar?=

is correct, and

    Subject: =?UTF-8?q?....=20f=C3=B6=C3?=      &lt;-- NOTE ö is broken here
     =?UTF-8?q?=B6=20bar?=

is not, because "ö" character UTF-8 encoding C3 B6 is split here across
adjacent encoded words.

To fix the problem, make the loop grab one _character_ at a time and
determine its output length to see where to break the output line.  Note
that this version only knows about UTF-8, but the logic to grab one
character is abstracted out in mbs_chrlen() function to make it possible
to extend it to other encodings with the help of iconv in the future.

Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: accept alternate spellings of UTF-8</title>
<updated>2013-02-25T21:17:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-02-25T20:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c680be113ec8aca49ddfbe93a9f43684d3d261e'/>
<id>urn:sha1:5c680be113ec8aca49ddfbe93a9f43684d3d261e</id>
<content type='text'>
The iconv implementation on many platforms will accept
variants of UTF-8, including "UTF8", "utf-8", and "utf8",
but some do not. We make allowances in our code to treat
them all identically, but we sometimes hand the string from
the user directly to iconv. In this case, the platform iconv
may or may not work.

There are really four levels of platform iconv support for
these synonyms:

  1. All synonyms understood (e.g., glibc).

  2. Only the official "UTF-8" understood (e.g., Windows).

  3. Official "UTF-8" not understood, but some other synonym
     understood (it's not known whether such a platform exists).

  4. Neither "UTF-8" nor any synonym understood (e.g.,
     ancient systems, or ones without utf8 support
     installed).

This patch teaches git to fall back to using the official
"UTF-8" spelling when iconv_open fails (and the encoding was
one of the synonym spellings). This makes things more
convenient to users of type 2 systems, as they can now use
any of the synonyms for the log output encoding.

Type 1 systems are not affected, as iconv already works on
the first try.

Type 4 systems are not affected, as both attempts already
fail.

Type 3 systems will not benefit from the feature, but
because we only use "UTF-8" as a fallback, they will not be
regressed (i.e., you can continue to use "utf8" if your
platform supports it). We could try all the various
synonyms, but since such systems are not even known to
exist, it's not worth the effort.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jx/utf8-printf-width'</title>
<updated>2013-02-14T18:29:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-14T18:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3cc3cf970c5ce477bde78df73614d1efba2b52eb'/>
<id>urn:sha1:3cc3cf970c5ce477bde78df73614d1efba2b52eb</id>
<content type='text'>
Use a new helper that prints a message and counts its display width
to align the help messages parse-options produces.

* jx/utf8-printf-width:
  Add utf8_fprintf helper that returns correct number of columns
</content>
</entry>
<entry>
<title>Add utf8_fprintf helper that returns correct number of columns</title>
<updated>2013-02-11T19:29:45Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2013-02-09T06:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c082196575e13dd5960031f213b20e2df989ca18'/>
<id>urn:sha1:c082196575e13dd5960031f213b20e2df989ca18</id>
<content type='text'>
Since command usages can be translated, they may include utf-8
encoded strings, and the output in console may not align well any
more. This is because strlen() is different from strwidth() on utf-8
strings.

A wrapper utf8_fprintf() can help to return the correct number of
columns required.

Signed-off-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Reviewed-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sp/shortlog-missing-lf'</title>
<updated>2013-01-02T18:40:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-02T18:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71288e15dfd6638d14b307b564d1230a4500daa1'/>
<id>urn:sha1:71288e15dfd6638d14b307b564d1230a4500daa1</id>
<content type='text'>
When a line to be wrapped has a solid run of non space characters
whose length exactly is the wrap width, "git shortlog -w" failed to
add a newline after such a line.

* sp/shortlog-missing-lf:
  strbuf_add_wrapped*(): Remove unused return value
  shortlog: fix wrapping lines of wraplen
</content>
</entry>
<entry>
<title>strbuf_add_wrapped*(): Remove unused return value</title>
<updated>2012-12-11T18:05:17Z</updated>
<author>
<name>Steffen Prohaska</name>
<email>prohaska@zib.de</email>
</author>
<published>2012-12-11T05:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0db1765c3bb108b55ebf82b4e5962f9d1f5e5b7'/>
<id>urn:sha1:e0db1765c3bb108b55ebf82b4e5962f9d1f5e5b7</id>
<content type='text'>
Since shortlog isn't using the return value anymore (see previous
commit), the functions can be changed to void.

Signed-off-by: Steffen Prohaska &lt;prohaska@zib.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/same-encoding' into maint</title>
<updated>2012-12-07T22:10:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-12-07T22:10:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fff26a68053022a2cbc39142c7c6f6d016837058'/>
<id>urn:sha1:fff26a68053022a2cbc39142c7c6f6d016837058</id>
<content type='text'>
Various codepaths checked if two encoding names are the same using
ad-hoc code and some of them ended up asking iconv() to convert
between "utf8" and "UTF-8".  The former is not a valid way to spell
the encoding name, but often people use it by mistake, and we
equated them in some but not all codepaths. Introduce a new helper
function to make these codepaths consistent.

* jc/same-encoding:
  reencode_string(): introduce and use same_encoding()
</content>
</entry>
<entry>
<title>Merge branch 'js/format-2047' into maint</title>
<updated>2012-11-20T17:57:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-11-20T17:57:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd778c09b1bb683d930dae59566bce79be89c628'/>
<id>urn:sha1:fd778c09b1bb683d930dae59566bce79be89c628</id>
<content type='text'>
Various rfc2047 quoting issues around a non-ASCII name on the From:
line in the output from format-patch have been corrected.

* js/format-2047:
  format-patch tests: check quoting/encoding in To: and Cc: headers
  format-patch: fix rfc2047 address encoding with respect to rfc822 specials
  format-patch: make rfc2047 encoding more strict
  format-patch: introduce helper function last_line_length()
  format-patch: do not wrap rfc2047 encoded headers too late
  format-patch: do not wrap non-rfc2047 headers too early
  utf8: fix off-by-one wrapping of text
</content>
</entry>
</feed>
