Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [JGIT PATCH 2/2] Add getPatchText functions to obtain the plain-text version of a patch

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:45:46

lördag 13 december 2008 12:02:07 skrev Robin Rosenberg:
lördag 13 december 2008 03:42:26 skrev Shawn O. Pearce:
quoted
The conversion from byte[] to String is performed one line at a time,
in case the patch is a character encoding conversion patch for the
file.  For simplicity we currently assume UTF-8 still as the default
encoding for any content, but eventually we should support using the
.gitattributes encoding property when performing this conversion.
For usefulness we must be able to pass the encoding from outside, 
e.g. the encoding Eclipse uses, which often is not UTF-8-
It's even worse. You should probably do the encoding guess on the whole
patch, or per file and not per line so make success possible at all. Reading
and writing as ISO-8859-1 will always work as that is just padding every
byte with NUL on reading and dropping it on writing. I.e. if your convert
to char at all...

-- robin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help