From patchwork Thu Dec 27 02:17:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 10743417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92A1F17FB for ; Thu, 27 Dec 2018 02:18:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82BF928B97 for ; Thu, 27 Dec 2018 02:18:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76EFE28B9A; Thu, 27 Dec 2018 02:18:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F19B28B9B for ; Thu, 27 Dec 2018 02:18:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbeL0CRr (ORCPT ); Wed, 26 Dec 2018 21:17:47 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:58000 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbeL0CRr (ORCPT ); Wed, 26 Dec 2018 21:17:47 -0500 Received: from genre.crustytoothpaste.net (S0106ac1f6b61f856.vc.shawcable.net [50.64.113.123]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id C081D60FDF; Thu, 27 Dec 2018 02:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1545877066; bh=ExDek1nAh1RVBWI6EadrO/0A8YFpN9gHzcnxdNwSS7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=BTksOdGijEcEbYLWzrNOiNhYrv5DkQu9G0WtxzCzu8Zi1SHRIMGQcPPFE2behEbMe vVwB7gfroVEy+yT8tNKmz6iTcskohJxlQbe77Ts835yD/BYvlh13rZdTweK+46PDov mQctHbhzom61cYGvAEp6VD1aSmD7czpE+3Ptpe2THGNZgjAzhUh8MEI6APJtVMVfoN LPV2WnwpcQhb+4uSy70cy/SXjxDRn+xZJM4693QTQEBjWKb2KdXWwODq7bBibWWnzy BElUNS6nxJFx1mXijhUVrRmtqeW1jS3SCM8jcskRkqDP2KKX+0lzj63ugQ19QbsE7L uSU0ZeByjo4xrQr/b8+m+7zvoZlA3BEzEP8qW/lyRpfunOryqCfFc2Y1T/U5LM5b3J TYGX2o/7Jj7J2FVm0Mil9PUY9WCsVhmgku5fOS13DqCE+sRVe2vSkPW/5MLdMcYBhN BhIqAAjoUbOiFCGLEI3EmBjqLI5+MXDdKUsszYJEt9kNCWrafjM From: "brian m. carlson" To: git@vger.kernel.org Cc: Lars Schneider , =?utf-8?q?Torsten_B=C3=B6gers?= =?utf-8?q?hausen?= Subject: [PATCH 1/2] Documentation: document UTF-16-related behavior Date: Thu, 27 Dec 2018 02:17:33 +0000 Message-Id: <20181227021734.528629-2-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.20.1.415.g653613c723 In-Reply-To: <20181227021734.528629-1-sandals@crustytoothpaste.net> References: <20181227021734.528629-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 127.0.1.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are a number of broken Windows programs which want to process files in a UTF-16 variant that is always little endian and always contains a BOM. Git cannot produce or accept such an encoding for the working-tree-encoding because no such encoding has been defined with IANA or implemented in iconv(3). Document this behavior since it is a frequent source of confusion for users. Additionally, document that specifying "UTF-16" may produce bytes of either endianness, but will be sure to provide a BOM to distinguish. Signed-off-by: brian m. carlson --- Documentation/gitattributes.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index b8392fc330..2b2c93afd1 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -330,6 +330,11 @@ That operation will fail and cause an error. - Reencoding content requires resources that might slow down certain Git operations (e.g 'git checkout' or 'git add'). +- It is not possible to specify a variant of UTF-16 with a BOM and a + specified endianness, because no such variants have been standardized. + Using "UTF-16" will produce a BOM with an unspecified endianness, and + using "UTF-16LE" or "UTF-16BE" will prohibit a BOM from being used. + Use the `working-tree-encoding` attribute only if you cannot store a file in UTF-8 encoding and if you want Git to be able to process the content as text.