Skip to contentSkip to conversation

Need multibyte advice - Shift-JIS

DISCUSSION Randall S. Becker 3 participants 18 messages Feb 27, 2019

lore
Share & tools
lore
#0 lore raw

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way to do this. This is CLI only, and our pager, less, does not support multi-byte, so I'm looking for options there also.

I normally do all of my UTF-16 work from a workstation via ECLIPSE, with UTF-8 comments, so never really have encountered this as an issue. Although our UTF-16 HTML files look pretty ugly in a diff.

The platform (NonStop) does not have a lot of UTF-16 tooling by default (less does not support it), so I may have to write stuff, which is no issue. We are on 2.21.0 officially as of yesterday.

Kind Regards,
Randall

-- Brief whoami:
NonStop developer since approximately 211288444200000000 UNIX developer since approximately 421664400
-- In my real life, I talk too much.

#1 lore raw
Quoted 7 lines · On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker"…

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way to do this. This is CLI only, and our pager, less, does not support multi-byte, so I'm looking for options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are running in UTF-8 SJIS will look like garbage.

HTH

Michal

#2 lore raw
Quoted 10 lines · Michal Suchánek
Quoted 7 lines · On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker"…

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way to do this. This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 8 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more clear.

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

#3 lore raw
Quoted 23 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 10 lines · Michal Suchánek
Quoted 7 lines · On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker"…

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way to do this. This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 8 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Quoted 9 lines

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more clear.

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

Thanks

Michal

#4 lore raw
Quoted 34 lines · Michal Suchánek
Quoted 31 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 11 lines · Michal Suchánek
Quoted 8 lines · On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker"…

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way to do this. This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more clear.

Quoted 6 lines
Quoted 3 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this platform.

#5 lore raw
Quoted 35 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 34 lines · Michal Suchánek
Quoted 31 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 11 lines · Michal Suchánek
Quoted 8 lines · On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker"…

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way to do this. This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more clear.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this platform.

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

HTH

Michal

#6 lore raw
Quoted 48 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

clear.

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

Quoted 8 lines

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this platform.

Quoted 1 line

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

To be more specific, the implementation of less' UTF-8 on this platform will present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to "get it fixed". Thanks for your advice.

#7 lore raw
Quoted 54 lines · On Wed, 27 Feb 2019 11:33:47 -0500 "Randall S. Becker"…
Quoted 53 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

clear.

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this platform.

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

To be more specific, the implementation of less' UTF-8 on this platform will present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to "get it fixed". Thanks for your advice.

How is this 'allowed encodings in less' defined?

Michal

#8 lore raw
Quoted 69 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 47 lines · On Wed, 27 Feb 2019 11:33:47 -0500 "Randall S. Becker"…
Quoted 46 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

clear.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this

platform.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

Quoted 7 lines
Quoted 1 line

To be more specific, the implementation of less' UTF-8 on this platform will

present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to "get it fixed". Thanks for your advice.

Quoted 1 line

How is this 'allowed encodings in less' defined?

When you run less with LESSCHARSET=encoding, if the encoding is not known, you get the error:
invalid charset name

Doing the due diligence, I actually read the man page on the platform before asking the question, which listed the following as the only allowed encodings: ascii, iso8859, latin1, latin9, dos, IBM-1047, koi8-r, next, utf-8, windows. The utf-8 variant does not know how to display its multi-byte forms in SJIS, as with other platforms. Does that make sense now?

#9 lore raw
Quoted 76 lines · On Wed, 27 Feb 2019 12:03:58 -0500 "Randall S. Becker"…
Quoted 75 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 47 lines · On Wed, 27 Feb 2019 11:33:47 -0500 "Randall S. Becker"…
Quoted 46 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

clear.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is usable.

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this

platform.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

To be more specific, the implementation of less' UTF-8 on this platform will

present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to "get it fixed". Thanks for your advice.

Quoted 1 line
Quoted 7 lines
Quoted 1 line

How is this 'allowed encodings in less' defined?

When you run less with LESSCHARSET=encoding, if the encoding is not known, you get the error:
invalid charset name

Doing the due diligence, I actually read the man page on the platform before asking the question, which listed the following as the only allowed encodings: ascii, iso8859, latin1, latin9, dos, IBM-1047, koi8-r, next, utf-8, windows. The utf-8 variant does not know how to display its multi-byte forms in SJIS, as with other platforms. Does that make sense now?

Does the said man page also mention LESSCHARDEF or LESSOPEN?

Michal

#10 lore raw
Quoted 93 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 49 lines · On Wed, 27 Feb 2019 12:03:58 -0500 "Randall S. Becker"…
Quoted 48 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 41 lines · On Wed, 27 Feb 2019 11:33:47 -0500 "Randall S. Becker"…
Quoted 40 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

clear.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is

usable.

Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this

platform.

Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

To be more specific, the implementation of less' UTF-8 on this platform will

present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to

"get it fixed".

Quoted 6 lines
Quoted 4 lines

Thanks for your advice.

Quoted 1 line

How is this 'allowed encodings in less' defined?

When you run less with LESSCHARSET=encoding, if the encoding is not

known, you get the error:

Quoted 2 lines

invalid charset name

Quoted 8 lines
Quoted 1 line

Doing the due diligence, I actually read the man page on the platform

before asking the question, which listed the following as the only allowed
encodings: ascii, iso8859, latin1, latin9, dos, IBM-1047, koi8-r, next, utf-8, windows. The utf-8 variant does not know how to display its multi-byte forms in SJIS, as with other platforms. Does that make sense now?

Quoted 1 line

Does the said man page also mention LESSCHARDEF or LESSOPEN?

Of course it does.

#11 lore raw
Quoted 101 lines · On Wed, 27 Feb 2019 12:38:06 -0500 "Randall S. Becker"…
Quoted 100 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 49 lines · On Wed, 27 Feb 2019 12:03:58 -0500 "Randall S. Becker"…
Quoted 48 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 41 lines · On Wed, 27 Feb 2019 11:33:47 -0500 "Randall S. Becker"…
Quoted 40 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

clear.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is

usable.

Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely multi-byte. I know this was fixed in RedHat's Less in 2016, but did not make this

platform.

Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

To be more specific, the implementation of less' UTF-8 on this platform will

present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to

"get it fixed".

Quoted 6 lines
Quoted 4 lines

Thanks for your advice.

Quoted 1 line

How is this 'allowed encodings in less' defined?

When you run less with LESSCHARSET=encoding, if the encoding is not

known, you get the error:

Quoted 3 lines

invalid charset name

Doing the due diligence, I actually read the man page on the platform

before asking the question, which listed the following as the only allowed
encodings: ascii, iso8859, latin1, latin9, dos, IBM-1047, koi8-r, next, utf-8, windows. The utf-8 variant does not know how to display its multi-byte forms in SJIS, as with other platforms. Does that make sense now?

Quoted 1 line
Quoted 4 lines
Quoted 1 line

Does the said man page also mention LESSCHARDEF or LESSOPEN?

Of course it does.

So what's the problem with displaying SJIS or even UTF-16 in less, exactly?

Also if you really don't like less there is lv.

Michal

#12 lore raw
Quoted 117 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 67 lines · On Wed, 27 Feb 2019 12:38:06 -0500 "Randall S. Becker"…
Quoted 66 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 51 lines · On Wed, 27 Feb 2019 12:03:58 -0500 "Randall S. Becker"…
Quoted 50 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

Quoted 43 lines · On Wed, 27 Feb 2019 11:33:47 -0500 "Randall S. Becker"…
Quoted 42 lines · On February 27, 2019 11:29 Michal Suchánek wrote:
Quoted 8 lines · On Wed, 27 Feb 2019 11:19:33 -0500 "Randall S. Becker"…
Quoted 7 lines · Michal Suchánek
Quoted 4 lines · On Wed, 27 Feb 2019 10:54:23 -0500 "Randall S. Becker"…
Quoted 3 lines · Michal Suchánek

On Wed, 27 Feb 2019 08:04:08 -0500 "Randall S. Becker" <[email protected]> wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Hi Git Team,

I have to admit being perplexed by this one. I have been asked to support the Shift-JIS character set in file contents, comments, and logs, for a partner of mine. I know there are a few ways to do this, but I'm looking for the official non-hacky way

to do this.

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 2 lines
Quoted 2 lines

This is CLI only, and our pager, less, does not support multi-byte, so I'm looking

for

Quoted 9 lines

options there also.

SJIS is about as much multibyte as UTF-8.

Why do you think less does not support it?

Last time I looked there was SJIS locale for libc so it is only matter of generating the correct locales and using them. Of course, if you are

running

Quoted 1 line

in UTF-8 SJIS will look like garbage.

Sadly, I did not personally build less on this platform, and the libc used did not include UTF-16, on the platform vendor supplied less. cat works fine, but the usual
LESSCHARSET=utf-16 is unsupported, so I am looking for an alternative. THAT is why I think less does not support it. Sorry, I should have made that more

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

clear.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

cat works fine, so if I set GIT_PAGER=cat, I can at least see the diffs cleanly in SJIS, but this partner wants a pager that is

usable.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

So you want to use SJIS because UTF-16 is not supported. So what is the problem with SJIS (or UTF-8 for that matter)?

The partner I am working with is using multi-byte SJIS, which is also not

supported by this incarnation of less. As a result, UTF-8 does not work either in this situation. The content is definitely

multi-byte.

Quoted 25 lines
Quoted 25 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

I know this was fixed in RedHat's Less in 2016, but did not make this

platform.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Both UTF-8 and SJIS is multibyte and both is supported by less in general. If your particular less cannot support it then it is broken and you should fix it or get it fixed.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

To be more specific, the implementation of less' UTF-8 on this platform will

present the data as unusable junk as expected. SJIS is multi-byte, but is not one of the allowed encodings in less. I am not empowered to

"get it fixed".

Quoted 7 lines
Quoted 4 lines

Thanks for your advice.

Quoted 1 line

How is this 'allowed encodings in less' defined?

When you run less with LESSCHARSET=encoding, if the encoding is not

known, you get the error:

Quoted 2 lines

invalid charset name

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

Doing the due diligence, I actually read the man page on the platform

before asking the question, which listed the following as the only allowed
encodings: ascii, iso8859, latin1, latin9, dos, IBM-1047, koi8-r, next, utf-8, windows. The utf-8 variant does not know how to display its multi-byte forms in SJIS, as with other platforms. Does that make

sense now?

Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Does the said man page also mention LESSCHARDEF or LESSOPEN?

Of course it does.

So what's the problem with displaying SJIS or even UTF-16 in less, exactly?

Also if you really don't like less there is lv.

I'm sorry if I was not clear about all this. NonStop is not a Linux platform. It is POSIX. Not all utilities are available and not all utilities have all capabilities. lv is not available for the platform. less considers the data binary and displays what usually is displayed when you try to use it for binary multibyte. You get @^@- and such. It does not present the data in the correct character set for the user.

This was only one part of my original question. I am searching elsewhere for support on pagers, because this really is not an appropriate discussion for the git group to focus on, do let's drop this, please, as not worth continuing. My original request was more about how to set up the file attributes, difference engine, and the rest of the git infrastructure. The partner I am working with is doing this with git hooks, which I am not really happy about. Let's prune this discussion as not worthy.

#13 lore raw
Quoted 10 lines · On Wed, 27 Feb 2019 12:59:15 -0500 "Randall S. Becker"…
Quoted 4 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

I'm sorry if I was not clear about all this. NonStop is not a Linux platform. It is POSIX. Not all utilities are available and not all utilities have all capabilities. lv is not available for the platform. less considers the data binary and displays what usually is displayed when you try to use it for binary multibyte. You get @^@- and such. It does not present the data in the correct character set for the user.

This was only one part of my original question. I am searching elsewhere for support on pagers, because this really is not an appropriate discussion for the git group to focus on, do let's drop this, please, as not worth continuing. My original request was more about how to set up the file attributes, difference engine, and the rest of the git infrastructure. The partner I am working with is doing this with git hooks, which I am not really happy about. Let's prune this discussion as not worthy.

Yes, this is totally unclear. Setting git hooks is possible but setting LESSCHARDEF is not?

Is patching git acceptable or is that out of question too?

What are your requirements, exactly?

If your data is in fact UTF-16 how is SJIS involved?

Michal

#14 lore raw
Quoted 25 lines · Michal Suchánek
Quoted 7 lines · On Wed, 27 Feb 2019 12:59:15 -0500 "Randall S. Becker"…
Quoted 4 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

I'm sorry if I was not clear about all this. NonStop is not a Linux platform. It

is POSIX. Not all utilities are available and not all utilities have all capabilities. lv is not available for the platform. less considers the data binary and displays what usually is displayed when you try to use it for binary multibyte. You get @^@- and such. It does not present the data in the correct character set for the user.

Quoted 2 lines

This was only one part of my original question. I am searching elsewhere

for support on pagers, because this really is not an appropriate discussion for the git group to focus on, do let's drop this, please, as not worth continuing. My original request was more about how to set up the file attributes, difference engine, and the rest of the git infrastructure. The partner I am working with is doing this with git hooks, which I am not really happy about. Let's prune this discussion as not worthy.

Quoted 1 line
Quoted 2 lines

Yes, this is totally unclear. Setting git hooks is possible but setting LESSCHARDEF is not?

It can enter the environment simply through .profile, where we can change GIT_PAGER. We have established that separately.

Quoted 1 line

Is patching git acceptable or is that out of question too?

I have done a bunch of git patching, where specifically.

Quoted 1 line

What are your requirements, exactly?

Source code and comments contain SJIS content. The requirement is to be able to move seamlessly in and out of git, and have git show/diff/log display SJIS as well as ASCII content. How that happens is open. The UTF-16 is a red-herring, only as an attempt at getting at SJIS content differently than the limitation imposed by less.

#15 lore raw
Quoted 28 lines · On Wed, 27 Feb 2019 13:50:18 -0500 "Randall S. Becker"…
Quoted 25 lines · Michal Suchánek
Quoted 7 lines · On Wed, 27 Feb 2019 12:59:15 -0500 "Randall S. Becker"…
Quoted 4 lines · Michal Suchánek

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: Need multibyte advice - Shift-JIS

I'm sorry if I was not clear about all this. NonStop is not a Linux platform. It

is POSIX. Not all utilities are available and not all utilities have all capabilities. lv is not available for the platform. less considers the data binary and displays what usually is displayed when you try to use it for binary multibyte. You get @^@- and such. It does not present the data in the correct character set for the user.

Quoted 2 lines

This was only one part of my original question. I am searching elsewhere

for support on pagers, because this really is not an appropriate discussion for the git group to focus on, do let's drop this, please, as not worth continuing. My original request was more about how to set up the file attributes, difference engine, and the rest of the git infrastructure. The partner I am working with is doing this with git hooks, which I am not really happy about. Let's prune this discussion as not worthy.

Quoted 1 line
Quoted 2 lines

Yes, this is totally unclear. Setting git hooks is possible but setting LESSCHARDEF is not?

Quoted 9 lines

It can enter the environment simply through .profile, where we can change GIT_PAGER. We have established that separately.

Quoted 1 line

Is patching git acceptable or is that out of question too?

I have done a bunch of git patching, where specifically.

Quoted 1 line

What are your requirements, exactly?

Source code and comments contain SJIS content. The requirement is to be able to move seamlessly in and out of git, and have git show/diff/log display SJIS as well as ASCII content. How that happens is open. The UTF-16 is a red-herring, only as an attempt at getting at SJIS content differently than the limitation imposed by less.

- less is a very limited pager when it comes to international support. Patches to support Japanese specifically were at a time merged in RedHat but then reverted because they broke other languages. If 'cat' pager is good enough except for the paging 'less -r' provides same plus the paging. You can fine-tune what is supposed to be displayed verbatim and what is supposed to be treated specially with LESSCHARDEF but it might not work well for SJIS. You can also set the LESS variable to include -r by default.

- if patching git is not out of question I don't see how adding a a full-featured pager such as lv is.

- I don't think git itself needs any adjustments to handle SJIS if it can handle UTF-8 already. UTF-16 would be a different story.

Michal

#16 lore raw
In reply to Randall S. Becker

Am 27.02.19 um 19:50 schrieb Randall S. Becker:

Quoted 7 lines · Michal Suchánek
Quoted 1 line

What are your requirements, exactly?

Source code and comments contain SJIS content. The requirement is to be able to move seamlessly in and out of git, and have git show/diff/log display SJIS as well as ASCII content. How that happens is open. The UTF-16 is a red-herring, only as an attempt at getting at SJIS content differently than the limitation imposed by less.

When your file content contains ShiftJIS, you should set an attribute in .gitattributes:

*.sourcecode encoding=ShiftJIS

When your git commits messages contain ShiftJIS, you should configure

git config i18n.commitEncoding ShiftJIS

More precisely, this assumes that your editor that composes to commits messages writes the .git/COMMIT_MSG in ShiftJIS.

When your terminal or pager is configured that it interprets the byte stream that it receives from applications for display as ShiftJIS, then you should configure

git config i18n.logOutputEncoding ShiftJIS

You can set this independently from the other settings. In particular, when it is not set, UTF-8 is assumed. That is, if your terminal or pager supports UTF-8, you should *NOT* set this configuration (or set it to UTF-8).

And, of course, you must have built Git with iconv, which must have support for ShiftJIS.

-- Hannes

#17 lore raw
Quoted 26 lines · Johannes Sixt

Am 27.02.19 um 19:50 schrieb Randall S. Becker:

Quoted 8 lines · Michal Suchánek
Quoted 1 line

What are your requirements, exactly?

Source code and comments contain SJIS content. The requirement is to be able to move seamlessly in and out of git, and have git show/diff/log display SJIS as well as ASCII content. How that happens is open. The
UTF-16 is a red-herring, only as an attempt at getting at SJIS content differently than the limitation imposed by less.

When your file content contains ShiftJIS, you should set an attribute in .gitattributes:

*.sourcecode encoding=ShiftJIS

When your git commits messages contain ShiftJIS, you should configure

git config i18n.commitEncoding ShiftJIS

More precisely, this assumes that your editor that composes to commits messages writes the .git/COMMIT_MSG in ShiftJIS.

When your terminal or pager is configured that it interprets the byte stream that it receives from applications for display as ShiftJIS, then you should configure

Quoted 8 lines

git config i18n.logOutputEncoding ShiftJIS

You can set this independently from the other settings. In particular, when it is not set, UTF-8 is assumed. That is, if your terminal or pager supports UTF- 8, you should *NOT* set this configuration (or set it to UTF-8).

And, of course, you must have built Git with iconv, which must have support for ShiftJIS.

Thanks. I will forward this along and check the iconv build and rev-level we have used in git. Many thanks.