Re: [git-users] UTF-8 file
On 31/10/2013 14:45, Konstantin Khomoutov wrote: On Thu, 31 Oct 2013 13:23:50 + Roddie Grant wrote: [...] For the record, I had to use 'git --no-pager diff' rather 'git diff --no-pager'. It solved the problem, but I was connected to the server. Using 'setenv LESSCHARSET utf-8' works, but only when I've ssh-ed to the remote web server. Making it persistent in Terminal (on the local Mac) has no effect. But if I connect to the server, then do 'setenv LESSCHARSET utf-8' before running git diff, I get the proper apostrophes etc. I've added 'setenv LESSCHARSET utf-8' to my .tcshrc file on the web server and all is well. I'm glad this helped but please next time be clear about what you're doing. I tried to re-read your original message in this thread and again failed to gather from it that your problem actually occured in an SSH session with a remote machine! SSH wasn't mentioned at all. I was sure you were having problems seeing a diff on your local system (Mac OS) directly running Git in Terminal. My apologies. I tried to keep the description of the problem succinct, but overdid it. The significance of the SSH session wasn't obvious to me :-( It just appeared to be Terminal being awkward. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] UTF-8 file
On Thu, 31 Oct 2013 13:23:50 + Roddie Grant wrote: [...] > For the record, I had to use 'git --no-pager diff' rather 'git diff > --no-pager'. It solved the problem, but I was connected to the server. > > Using 'setenv LESSCHARSET utf-8' works, but only when I've ssh-ed to > the remote web server. Making it persistent in Terminal (on the local > Mac) has no effect. But if I connect to the server, then do 'setenv > LESSCHARSET utf-8' before running git diff, I get the proper > apostrophes etc. > > I've added 'setenv LESSCHARSET utf-8' to my .tcshrc file on the web > server and all is well. I'm glad this helped but please next time be clear about what you're doing. I tried to re-read your original message in this thread and again failed to gather from it that your problem actually occured in an SSH session with a remote machine! SSH wasn't mentioned at all. I was sure you were having problems seeing a diff on your local system (Mac OS) directly running Git in Terminal. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] UTF-8 file
On 31/10/2013 12:00, Konstantin Khomoutov wrote: On Thu, 31 Oct 2013 10:51:11 + Roddie Grant wrote: [...] When I do git diff in Terminal I get output like: -<80><9C>SurfexPlus<80><9D> is OCCA<80><99>s [...] Care to tell us which OS is that? [...] Another question: do you see this in a pager or plainly rendered by the terminal emulator? [...] Another question (if this really happens on a Mac): what does `locale` run in that terminal emulator tell to you? [...] I'm definitely out of my depth here :-( but the answers are the webserver is Linux (CentOS Linux 4.9), and I'm using my MacBook (10.6.8) to connect to it with ssh. There is a pager running in the Mac Terminal app. I usually get ":" (which means hit spacebar to scroll) or "END". [...] This is of no relevance to your problem: Git generates and shows you the diff on your local machine, the server is not involved with this in any way. [...] OK, now let's try a couple of things: 1) If you run `git diff --no-pager ...` so that the output goes plainly into the hands of Terminal and rendered by it directly, do you see those non-ASCII characters OK? If this works for you, `less` is the culprit so read on. 2) Try setting the LESSCHARSET environment variable to "utf-8". You can do this for the current Terminal session by executing export LESSCHARSET=utf-8 in it before running any `git diff` command. [...] 3) Try playing with the LESS environment variable (which, if exists, contains a set of command-line options for `less` to consume as if they vere explicitly passed to it). The command-line option of interest are "-R" (better) or "-r" (worse). Also "-X" might be of relevance (though I doubt it). [...] Thanks for all your help; it is much appreciated. For the record, I had to use 'git --no-pager diff' rather 'git diff --no-pager'. It solved the problem, but I was connected to the server. Using 'setenv LESSCHARSET utf-8' works, but only when I've ssh-ed to the remote web server. Making it persistent in Terminal (on the local Mac) has no effect. But if I connect to the server, then do 'setenv LESSCHARSET utf-8' before running git diff, I get the proper apostrophes etc. I've added 'setenv LESSCHARSET utf-8' to my .tcshrc file on the web server and all is well. Many thanks Roddie -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] UTF-8 file
On Thu, 31 Oct 2013 10:51:11 + Roddie Grant wrote: [...] > >> When I do git diff in Terminal I get output like: > >> -<80><9C>SurfexPlus<80><9D> is OCCA<80><99>s [...] > > Care to tell us which OS is that? [...] > > Another question: do you see this in a pager or plainly rendered by > > the terminal emulator? [...] > > Another question (if this really happens on a Mac): what does > > `locale` run in that terminal emulator tell to you? [...] > I'm definitely out of my depth here :-( but the answers are the > webserver is Linux (CentOS Linux 4.9), and I'm using my MacBook > (10.6.8) to connect to it with ssh. > > There is a pager running in the Mac Terminal app. I usually get ":" > (which means hit spacebar to scroll) or "END". Ah, yes, this means Git spawned "less" [1] -- a popular and rather advanced pager program. > 'locale' when ssh-ed to the server returns > LANG= > LC_CTYPE="POSIX" [...] This is of no relevance to your problem: Git generates and shows you the diff on your local machine, the server is not involved with this in any way. > 'locale' on the Mac returns > LANG="en_GB.UTF-8" [...] This looks perfectly reasonable so we should conclude you have no problems with your locale. OK, now let's try a couple of things: 1) If you run `git diff --no-pager ...` so that the output goes plainly into the hands of Terminal and rendered by it directly, do you see those non-ASCII characters OK? If this works for you, `less` is the culprit so read on. 2) Try setting the LESSCHARSET environment variable to "utf-8". You can do this for the current Terminal session by executing export LESSCHARSET=utf-8 in it before running any `git diff` command. If this fixes the problem for you, consider making this setting persistent (for your user or system-wide). How exactly to do that, I don't know (I lack experience with Macs), so try googling for mac+os+set+environment+variable+permanently or may be someone here will suggest a solution off-hand. 3) Try playing with the LESS environment variable (which, if exists, contains a set of command-line options for `less` to consume as if they vere explicitly passed to it). The command-line option of interest are "-R" (better) or "-r" (worse). Also "-X" might be of relevance (though I doubt it). So try doing: export LESS=-R and then running `git diff` to see if this helps. If this leads to no positive result, try `export LESS=-r` or try combining "-r" and "-R" with "-X", like in `export LESS=-RX`. 1. http://en.wikipedia.org/wiki/Less_%28Unix%29 -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] UTF-8 file
On 31/10/2013 10:20, Konstantin Khomoutov wrote: On Thu, 31 Oct 2013 10:03:25 + Roddie Grant wrote: I have a file on my web server which BBedit shows as UTF-8. It includes proper "curly" apostophes and quotation marks. When I do git diff in Terminal I get output like: -<80><9C>SurfexPlus<80><9D> is OCCA<80><99>s biennial... Does this matter? It's a bit of a distraction visually, so is there a sensible way to avoid it? Care to tell us which OS is that? I have a vague idea this might be Mac OS (if "Terminal" has its "T" capitalized on purpose). Another question: do you see this in a pager or plainly rendered by the terminal emulator? You can easily tell that: if after showing a diff you're prompted (at the bottom) to scroll or exit or whatever, you're facing a pager running, and if you just see a command prompt no pager has been run. Another question (if this really happens on a Mac): what does `locale` run in that terminal emulator tell to you? Supposedly you should see something mentioning UTF-8 there, not just "C", and this should be either in LC_MESSAGES or LANG or LANGUAGE (I dunno which one applies to Darwin environment). Plain "C" locale means the software should do no interpretation of bytes it jiggles at all while UTF-8 means whatever text it processed should be interpreted as UTF-8 byte sequences unless explicitly stated otherwise. Thanks Konstantin I'm definitely out of my depth here :-( but the answers are the webserver is Linux (CentOS Linux 4.9), and I'm using my MacBook (10.6.8) to connect to it with ssh. There is a pager running in the Mac Terminal app. I usually get ":" (which means hit spacebar to scroll) or "END". 'locale' when ssh-ed to the server returns LANG= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= 'locale' on the Mac returns LANG="en_GB.UTF-8" LC_COLLATE="en_GB.UTF-8" LC_CTYPE="en_GB.UTF-8" LC_MESSAGES="en_GB.UTF-8" LC_MONETARY="en_GB.UTF-8" LC_NUMERIC="en_GB.UTF-8" LC_TIME="en_GB.UTF-8" LC_ALL= Thanks Roddie -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] UTF-8 file
On Thu, 31 Oct 2013 10:03:25 + Roddie Grant wrote: > I have a file on my web server which BBedit shows as UTF-8. It > includes proper "curly" apostophes and quotation marks. > > When I do git diff in Terminal I get output like: > -<80><9C>SurfexPlus<80><9D> is OCCA<80><99>s > biennial... > > Does this matter? It's a bit of a distraction visually, so is there a > sensible way to avoid it? Care to tell us which OS is that? I have a vague idea this might be Mac OS (if "Terminal" has its "T" capitalized on purpose). Another question: do you see this in a pager or plainly rendered by the terminal emulator? You can easily tell that: if after showing a diff you're prompted (at the bottom) to scroll or exit or whatever, you're facing a pager running, and if you just see a command prompt no pager has been run. Another question (if this really happens on a Mac): what does `locale` run in that terminal emulator tell to you? Supposedly you should see something mentioning UTF-8 there, not just "C", and this should be either in LC_MESSAGES or LANG or LANGUAGE (I dunno which one applies to Darwin environment). Plain "C" locale means the software should do no interpretation of bytes it jiggles at all while UTF-8 means whatever text it processed should be interpreted as UTF-8 byte sequences unless explicitly stated otherwise. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] UTF-8 file
I have a file on my web server which BBedit shows as UTF-8. It includes proper "curly" apostophes and quotation marks. When I do git diff in Terminal I get output like: -<80><9C>SurfexPlus<80><9D> is OCCA<80><99>s biennial... Does this matter? It's a bit of a distraction visually, so is there a sensible way to avoid it? Thanks -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.