Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] git-p4: add "--path-encoding" option

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:22

Torsten Bögershausen [off-list ref] writes:
On 2015-08-31 19.40, Junio C Hamano wrote:
quoted
larsxschneider@gmail.com writes:
quoted
quoted
+test_expect_success 'Create a repo containing cp1251 encoded paths' '
+	cd "$cli" &&
+
+	FILENAME="$(echo "a-¤_o-¶_u-¼.txt" | iconv -f utf-8 -t cp1252)" &&
 ...
Using file names and iconv like this may not be portable:
- cp1252 may be called CP1252 (or may not be available)
"git grep 'cp[0-9]' t/" does tell us that we refrain from using them
and I am sure the portability worries is a big reason.  Thank you
for pointing it out.
- reading from stdin is not necessarily supported by iconv
"git grep '| iconv' t/" tells me that this is irrelevant; we already
heavily depend on it.
- creating files in CP1252 may not be supported under Mac OS
   (Not sure about Windows)
The same as the first point, which is a good thing to worry about.
One solution could be to use ISO-8859-1, convert into UTF-8,
and "convert into UTF-8" one more time.
I do not quite get it; do you need to do anything more than just
replacing cp1252 with iso-8859-1 in the patch being discussed?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help