detecting ASCII/EBCDIC 
September 2nd, 2008, 10:15 PM
| | | detecting ASCII/EBCDIC
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment? | 
September 2nd, 2008, 10:25 PM
| | | Re: detecting ASCII/EBCDIC
Pilcrow <pilcrow@pp.infowrites: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| You could do something like this:
if ('A' == 0x41) {
/* Probably ASCII. */
} else if ('A' == 0xc1) {
/* Probably EBCDIC. */
}
--
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa6 7f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1:putchar(a[i&15]);break;}}} | 
September 2nd, 2008, 10:25 PM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 1:11 am, Pilcrow <pilc...@pp.infowrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
|
No.
But you can check if a certain symbol has been mapped to the same
value as ASCII/EBCDIC:
#if 'A' == 65
/* A is mapped to the same value as ASCII */
#elif
/* A is not mapped to the same value as ASCII */
#endif
That's not telling you much though. | 
September 2nd, 2008, 10:25 PM
| | | Re: detecting ASCII/EBCDIC
Pilcrow said: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| Almost.
What you can do is check code points for the basic character set. If 'A' is
65, and 'B' is 66, and... (etc) and 'Z' is, er, 90, and 'a' is 97, and 'b'
is 98, and... (etc) and 'z' is 122, and the digits are 48 through 57, and
' ' is 32, and so on and so forth with all the !"%^&*()_-=+<,>.?/\\;:'~#
stuff, and if '\n' is 10 and '\r' is 13 and '\f' is 12 and so on, then the
chances are very good that it's ASCII.
Some trick for EBCDIC, but with different numbers.
Not 100% foolproof, but it may suit your needs - and if those two character
sets are your only two choices, then you can do it with a single
comparison ('A' == 65) and be assured that your result is correct.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999 | 
September 2nd, 2008, 10:35 PM
| | | Re: detecting ASCII/EBCDIC
On 2 Sep 2008 at 22:11, Pilcrow wrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| #include <stdio.h>
#include <time.h>
int main(void)
{
time_t t;
time(&t);
if(gmtime(&t)->tm_year 75)
puts("ASCII!");
return 0;
} | 
September 2nd, 2008, 10:35 PM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 1:22 am, vipps...@gmail.com wrote: Quote:
On Sep 3, 1:11 am, Pilcrow <pilc...@pp.infowrote:
> Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| >
No.
But you can check if a certain symbol has been mapped to the same
value as ASCII/EBCDIC:
>
#if 'A' == 65
/* A is mapped to the same value as ASCII */
#elif
| ^^^^
That should've been 'else'. | 
September 2nd, 2008, 10:35 PM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 1:29 am, Richard Heathfield <r...@see.sig.invalidwrote: Quote:
Pilcrow said:
> Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| >
Almost.
>
What you can do is check code points for the basic character set. If 'A' is
65, and 'B' is 66, and... (etc) and 'Z' is, er, 90, and 'a' is 97, and 'b'
is 98, and... (etc) and 'z' is 122, and the digits are 48 through 57, and [...]
| You only need to check for one digit, it's guaranteed that '9' - '0'
== 9.
<snip> | 
September 2nd, 2008, 10:35 PM
| | | Re: detecting ASCII/EBCDIC
Pilcrow wrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| You could check some known chars against the EBCDIC and ASCII
numeric values:
if ('0' == 48 && 'A' == 65 && 'z' == 122 && ...)
puts ("Looks like ASCII");
else if ('0' == 240 && 'A' == 193 && 'z' == 169 && ...)
puts ("Looks like EBCDIC");
else
puts ("Now I *know* we're not in Kansas!");
It seems an uncertain business, though, because both ASCII and EBCDIC
define characters that can't be written as portable character literals
(what do you put between the '' to get EBCDIC's RSP character *and*
have it mean something on an ASCII system?), and because I don't see
how you can reliably distinguish between an ASCII system and one that
uses a more modern encoding that includes ASCII as a subset.
What's the purpose?
-- Eric.Sosman@sun.com | 
September 2nd, 2008, 10:35 PM
| | | Re: detecting ASCII/EBCDIC
Pilcrow wrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| You can check character values. Why do you want to?
Brian | 
September 2nd, 2008, 11:15 PM
| | | Re: detecting ASCII/EBCDIC vippstar@gmail.com writes: Quote:
But you can check if a certain symbol has been mapped to the same
value as ASCII/EBCDIC:
>
#if 'A' == 65
/* A is mapped to the same value as ASCII */
#elif
/* A is not mapped to the same value as ASCII */
#endif
| I don't think that's guaranteed to work, because preprocessor
directives are interpreted in the source character set, which may
differ arbitrarily from the execution character set. It could be
the case that the source character set is ASCII and the execution
character set is EBCDIC, as far as I know.
--
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa6 7f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1:putchar(a[i&15]);break;}}} | 
September 2nd, 2008, 11:25 PM
| | | Re: detecting ASCII/EBCDIC
On September 2, 2008 18:11, in comp.lang.c, Pilcrow (pilcrow@pp.info) wrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| Which EBCDIC? There are about 30 EBCDIC variants to choose from. See all the
EBCDIC-xx charts at http://anubis.dkuug.dk/i18n/charmaps/ (the site of the
ISO Internationalization effort)
FWIW, the exclamation mark ('!') is 0x21 in ASCII, 0x5a in EBCDIC-US, and
0x4f in EBCDIC-INT.
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576 http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------ | 
September 3rd, 2008, 12:05 AM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 2:09 am, Ben Pfaff <b...@cs.stanford.eduwrote: Quote:
vipps...@gmail.com writes: Quote:
But you can check if a certain symbol has been mapped to the same
value as ASCII/EBCDIC:
| > Quote:
#if 'A' == 65
/* A is mapped to the same value as ASCII */
#elif
/* A is not mapped to the same value as ASCII */
#endif
| >
I don't think that's guaranteed to work, because preprocessor
directives are interpreted in the source character set, which may
differ arbitrarily from the execution character set. It could be
the case that the source character set is ASCII and the execution
character set is EBCDIC, as far as I know.
| Ah - I did not think of that. Then perhaps change it to `if'.
if('A' == 65) { ... } | 
September 3rd, 2008, 12:55 AM
| | | Re: detecting ASCII/EBCDIC
Pilcrow <pilcrow@pp.infowrites: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| As others have suggested, testing the numeric values of some
characters will probably tell you.
But note that there are several different variants of EBCDIC. As for
ASCII, remember that it's only a 7-bit character set. There are
numerous larger sets based on ASCII. There are the 8-bit ISO 8859-N
sets, with N running from 1 to about 15 last I heard. There's
Unicode. There's a Windows-specific 8-bit extension to ASCII. And
there are national variants that replace some of the punctuation
characters with accented letters, though these aren't used much
anymore.
If at all possible, it's better to write your code so it will work
with *any* character set. For example, if you want to know whether a
character is a lowercase letter, don't use (c >= 'a' && c <= 'z'), use
isascii(unsigned char(c)).
What problem are you really trying to solve?
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister" | 
September 3rd, 2008, 01:15 AM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 3:47 am, Keith Thompson <ks...@mib.orgwrote: Quote:
Pilcrow <pilc...@pp.infowrites: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| >
As others have suggested, testing the numeric values of some
characters will probably tell you.
>
But note that there are several different variants of EBCDIC. As for
ASCII, remember that it's only a 7-bit character set. There are
numerous larger sets based on ASCII. There are the 8-bit ISO 8859-N
sets, with N running from 1 to about 15 last I heard. There's
Unicode. There's a Windows-specific 8-bit extension to ASCII. And
there are national variants that replace some of the punctuation
characters with accented letters, though these aren't used much
anymore.
>
If at all possible, it's better to write your code so it will work
with *any* character set. For example, if you want to know whether a
character is a lowercase letter, don't use (c >= 'a' && c <= 'z'), use
isascii(unsigned char(c)).
| That should be islower((unsigned char)c) of course.
(it's not the unsigned char mistake that bugs me; it's the isascii()
one :S) | 
September 3rd, 2008, 01:35 AM
| | | Re: detecting ASCII/EBCDIC vippstar@gmail.com writes: Quote: |
On Sep 3, 3:47 am, Keith Thompson <ks...@mib.orgwrote:
| [...] Quote: Quote:
>If at all possible, it's better to write your code so it will work
>with *any* character set. For example, if you want to know whether a
>character is a lowercase letter, don't use (c >= 'a' && c <= 'z'), use
>isascii(unsigned char(c)).
| >
That should be islower((unsigned char)c) of course.
(it's not the unsigned char mistake that bugs me; it's the isascii()
one :S)
| D'oh! You're right, of course (and both mistakes bug me equally).
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister" | 
September 3rd, 2008, 04:45 AM
| | | Re: detecting ASCII/EBCDIC
On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilcrow@pp.infowrote: Quote:
>Is there a way that a proram can detect whether it is operating in an
>ASCII or an EBCDIC environment?
| OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
have ASCII. Most likely we have some flavor of EBCDIC. But, since the
compiler will have been compiled in either the ASCII or the EBCDIC
environment, it seems that there could have been some macro that would
have told us so directly.
IBM definitely is MS's predecessor in promoting incompatibility. But I
knew that years ago.
Again, I apologize for inadvertantly casting aspersions on your favorite
language. People often (and in clc) make slurs against Perl; it doesn't
bother me. | 
September 3rd, 2008, 04:55 AM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote: Quote:
On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilc...@pp.infowrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| >
OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| That expression invokes undefined behavior if 'i' equals INT_MAX.
<snip> | 
September 3rd, 2008, 05:05 AM
| | | Re: detecting ASCII/EBCDIC
On Tue, 2 Sep 2008 21:49:51 -0700 (PDT), vippstar@gmail.com wrote: Quote:
>On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote: Quote:
>On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilc...@pp.infowrote: Quote:
>Is there a way that a proram can detect whether it is operating in an
>ASCII or an EBCDIC environment?
| >>
>OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| >
>That expression invokes undefined behavior if 'i' equals INT_MAX.
>
><snip>
| Would it ever? and when? | 
September 3rd, 2008, 05:05 AM
| | | Re: detecting ASCII/EBCDIC
On Tue, 02 Sep 2008 21:49:51 -0700, vippstar wrote: Quote:
On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote: Quote:
>On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilc...@pp.infowrote: Quote:
>Is there a way that a proram can detect whether it is operating in an
>ASCII or an EBCDIC environment?
| >>
>OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| >
That expression invokes undefined behavior if 'i' equals INT_MAX.
| If the character set is either ASCII or EBCDIC, 'i' cannot equal INT_MAX.
If it is not, the check is insufficient anyway. | 
September 3rd, 2008, 05:25 AM
| | | Re: detecting ASCII/EBCDIC
Harald van Dijk wrote: Quote:
On Tue, 02 Sep 2008 21:49:51 -0700, vippstar wrote: Quote:
>On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote: Quote:
>>On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilc...@pp.infowrote:
>>>Is there a way that a proram can detect whether it is operating in an
>>>ASCII or an EBCDIC environment?
>>OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| >That expression invokes undefined behavior if 'i' equals INT_MAX.
| >
If the character set is either ASCII or EBCDIC, 'i' cannot equal INT_MAX.
If it is not, the check is insufficient anyway.
| if ('a' != 97) puts("Not ASCII");
if ('a' != 129) puts("Not EBCDIC");
--
pete | 
September 3rd, 2008, 05:35 AM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 8:03 am, Harald van D©¦k <true...@gmail.comwrote: Quote:
On Tue, 02 Sep 2008 21:49:51 -0700, vippstar wrote: Quote:
On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote: Quote:
On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilc...@pp.infowrote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| | > Quote: Quote: |
OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| | > Quote: |
That expression invokes undefined behavior if 'i' equals INT_MAX.
| >
If the character set is either ASCII or EBCDIC, 'i' cannot equal INT_MAX.
| So? 'i' + 1 still invokes undefined behavior :) Quote: |
If it is not, the check is insufficient anyway.
| I agree. | 
September 3rd, 2008, 07:55 AM
| | | Re: detecting ASCII/EBCDIC
On 2 Sep, 23:25, Antoninus Twink <nos...@nospam.invalidwrote: Quote: |
On 2 Sep 2008 at 22:11, Pilcrow wrote:
| Quote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| >
#include <stdio.h>
#include <time.h>
>
int main(void)
{
time_t t;
time(&t);
if(gmtime(&t)->tm_year 75)
puts("ASCII!");
return 0;
}
| despite what twink implies I believe EBCDIC machines do still
exist. The IBM mainfram world is still alive and well.
--
Nick Keighley | 
September 3rd, 2008, 09:05 AM
| | | Re: detecting ASCII/EBCDIC
Nick Keighley <nick_keighley_nospam@hotmail.comwrites: Quote:
On 2 Sep, 23:25, Antoninus Twink <nos...@nospam.invalidwrote: Quote: |
>On 2 Sep 2008 at 22:11, Pilcrow wrote:
| > Quote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| >>
>#include <stdio.h>
>#include <time.h>
>>
>int main(void)
>{
> time_t t;
> time(&t);
> if(gmtime(&t)->tm_year 75)
> puts("ASCII!");
> return 0;
>}
| >
despite what twink implies I believe EBCDIC machines do still
exist. The IBM mainfram world is still alive and well.
| Yes. But one has to wonder how many routines written by people looking
for help here will end up running on them.... | 
September 3rd, 2008, 09:25 AM
| | | Re: detecting ASCII/EBCDIC
<vippstar@gmail.comwrote in message
news:f00bebcc-8539-4240-bca8-9ff3c5ed388e@z66g2000hsc.googlegroups.com... Quote:
On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote: Quote:
>On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilc...@pp.infowrote: Quote:
>Is there a way that a proram can detect whether it is operating in an
>ASCII or an EBCDIC environment?
| >>
>OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| >
That expression invokes undefined behavior if 'i' equals INT_MAX.
| If one has to continually worry about a+1 invoking undefined behaviour, then
no line of code is ever going to get written.
Anyway your example should give a compile-time error.
--
Bartc | 
September 3rd, 2008, 09:35 AM
| | | Re: detecting ASCII/EBCDIC
On Sep 3, 12:15 pm, "Bartc" <b...@freeuk.comwrote: Quote:
<vipps...@gmail.comwrote in message
>
news:f00bebcc-8539-4240-bca8-9ff3c5ed388e@z66g2000hsc.googlegroups.com...
> Quote: |
On Sep 3, 7:41 am, Pilcrow <pilc...@pp.infowrote:
| > Quote: Quote: |
OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
| | > Quote: |
That expression invokes undefined behavior if 'i' equals INT_MAX.
| >
If one has to continually worry about a+1 invoking undefined behaviour, then
no line of code is ever going to get written.
| a+1 no. 'i' + 1 perhaps, and I disagree. There's already many lines of
code written that do not invoke undefined behavior. Quote: |
Anyway your example should give a compile-time error.
| I know. I have written a correction in a follow-up
Message-ID:
<795a77f1-1dd2-4d6f-834f-43ec772b398b@y21g2000hsf.googlegroups.com>
Unless you are referring to something else. | 
September 3rd, 2008, 11:55 AM
| | | Re: detecting ASCII/EBCDIC
Pilcrow wrote: Quote:
On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilcrow@pp.infowrote:
> Quote:
>Is there a way that a proram can detect whether it is operating in an
>ASCII or an EBCDIC environment?
| >
OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
have ASCII. Most likely we have some flavor of EBCDIC. But, since the
compiler will have been compiled in either the ASCII or the EBCDIC
environment, it seems that there could have been some macro that would
have told us so directly.
| I think you're assuming that ASCII and EBCDIC are the only two
possibilities. There are LOTS of other possibilities, including a fairly
large number that are in wide use. Unicode, in particular, is very
widely used. | 
September 3rd, 2008, 01:15 PM
| | | Re: detecting ASCII/EBCDIC
Pilcrow wrote: Quote:
On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilcrow@pp.infowrote:
> Quote:
>Is there a way that a proram can detect whether it is operating in an
>ASCII or an EBCDIC environment?
| >
OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
have ASCII. Most likely we have some flavor of EBCDIC. But, since the
compiler will have been compiled in either the ASCII or the EBCDIC
environment, it seems that there could have been some macro that would
have told us so directly.
| I don't see how. When you take into account the fact that
things like "code pages" can change at run-time, the compiler
seems at a disadvantage in trying to predict them ...
Again, what's the purpose? What are you trying to accomplish
that requires you to know whether the system uses ASCII (which
variant?), EBCDIC (which variant?), ISO 8859-1, ...?
-- Eric.Sosman@sun.com | 
September 3rd, 2008, 01:15 PM
| | | Re: detecting ASCII/EBCDIC
Eric Sosman <Eric.Sosman@sun.comwrites: Quote:
Pilcrow wrote: Quote:
On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilcrow@pp.infowrote: Quote:
Is there a way that a proram can detect whether it is operating in an
ASCII or an EBCDIC environment?
| OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
have ASCII. Most likely we have some flavor of EBCDIC. But, since the
compiler will have been compiled in either the ASCII or the EBCDIC
environment, it seems that there could have been some macro that would
have told us so directly.
| >
I don't see how. When you take into account the fact that
things like "code pages" can change at run-time, the compiler
seems at a disadvantage in trying to predict them ...
| ISTR that the characters in the basic characters set have their code the
same in all supported locale (ie you can't have support for both a
EBCDIC-based and a ASCII-based locale without having one of them remap the
characters).
Yours,
--
Jean-Marc | 
September 4th, 2008, 02:05 AM
| | | Re: detecting ASCII/EBCDIC
Jean-Marc Bourguet wrote: Quote:
Eric Sosman <Eric.Sosman@sun.comwrites:
> Quote:
>Pilcrow wrote: Quote:
>>On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <pilcrow@pp.infowrote:
>>>
>>>Is there a way that a proram can detect whether it is operating in an
>>>ASCII or an EBCDIC environment?
>>OK, it seems I have my answer: if('i' + 1 != 'j') we definitely don't
>>have ASCII. Most likely we have some flavor of EBCDIC. But, since the
>>compiler will have been compiled in either the ASCII or the EBCDIC
>>environment, it seems that there could have been some macro that would
>>have told us so directly.
| > I don't see how. When you take into account the fact that
>things like "code pages" can change at run-time, the compiler
>seems at a disadvantage in trying to predict them ...
| >
ISTR that the characters in the basic characters set have their code the
same in all supported locale (ie you can't have support for both a
EBCDIC-based and a ASCII-based locale without having one of them remap the
characters).
| If the question is restricted to the encoding of the
basic execution set -- the characters that the Standard
requires to be present -- then a straightforward exhaustive
test can determine whether the encoding for those characters
is "consistent with ASCII" or "consistent with EBCDIC" or
"consistent with neither." But is that enough for the O.P.?
Again, yet again, we get back to the question: What is he
*really* trying to find out, and why? (Since the question
has been asked at least four times by at least three people
and has elicited no answer, I'm beginning to think he doesn't
know.)
--
Eric Sosman esosman@ieee-dot-org.invalid | 
September 4th, 2008, 03:05 AM
| | | Re: detecting ASCII/EBCDIC
"Eric Sosman" writes: Quote:
If the question is restricted to the encoding of the
basic execution set -- the characters that the Standard
requires to be present -- then a straightforward exhaustive
test can determine whether the encoding for those characters
is "consistent with ASCII" or "consistent with EBCDIC" or
"consistent with neither." But is that enough for the O.P.?
Again, yet again, we get back to the question: What is he
*really* trying to find out, and why? (Since the question
has been asked at least four times by at least three people
and has elicited no answer, I'm beginning to think he doesn't
know.)
| My guess is that he is one of those annoying (to many of the regulars on
this froup) curious guys who just likes to know things.
Pretty pathetic, huh? | 
September 4th, 2008, 03:55 AM
| | | Re: detecting ASCII/EBCDIC
On Wed, 3 Sep 2008 20:03:51 -0700, "osmium" <r124c4u102@comcast.net>
wrote: Quote:
>"Eric Sosman" writes:
> Quote:
> If the question is restricted to the encoding of the
>basic execution set -- the characters that the Standard
>requires to be present -- then a straightforward exhaustive
>test can determine whether the encoding for those characters
>is "consistent with ASCII" or "consistent with EBCDIC" or
>"consistent with neither." But is that enough for the O.P.?
>Again, yet again, we get back to the question: What is he
>*really* trying to find out, and why? (Since the question
>has been asked at least four times by at least three people
>and has elicited no answer, I'm beginning to think he doesn't
>know.)
| >
>My guess is that he is one of those annoying (to many of the regulars on
>this froup) curious guys who just likes to know things.
>
>Pretty pathetic, huh?
>
| Thank you, Os.
----
If you refrain from asking questions from fear of seeming
stupid, you'll never learn, and that would be stupid. | 
September 4th, 2008, 04:15 AM
| | | Re: detecting ASCII/EBCDIC
On Tue, 02 Sep 2008 21:41:45 -0700, Pilcrow <pilcrow@pp.infowrote:
snip Quote:
>
>IBM definitely is MS's predecessor in promoting incompatibility. But I
>knew that years ago.
| Incompatibility with what? Baudot?
--
Remove del for email | 
September 4th, 2008, 04:45 AM
| | | Re: detecting ASCII/EBCDIC
On Wed, 03 Sep 2008 21:12:11 -0700, Barry Schwarz <schwarzb@dqel.com>
wrote: Quote:
>On Tue, 02 Sep 2008 21:41:45 -0700, Pilcrow <pilcrow@pp.infowrote:
>
>
>snip
> Quote:
>>
>>IBM definitely is MS's predecessor in promoting incompatibility. But I
>>knew that years ago.
| >
>Incompatibility with what? Baudot?
| In IBM's case, often with itself.
----
If you refrain from asking questions from fear of seeming
stupid, you'll never learn, and that would be stupid. | 
September 4th, 2008, 04:45 AM
| | | Re: detecting ASCII/EBCDIC
Pilcrow said: Quote:
On Thu, 04 Sep 2008 04:22:06 +0000, Richard Heathfield
<rjh@see.sig.invalidwrote:
> | <snip> Quote: Quote:
>> Quote:
>>If you refrain from asking questions from fear of seeming
>>stupid, you'll never learn, and that would be stupid.
| >>
>>And if you refrain from asking clear questions from fear of seeming
>>verbose, you'll never get a clear answer, and that, too, would be stupid.
| >
And if I don't know enough to put a question in the acceptable form?
| It's not so much a matter of "the acceptable form" - plenty of forms are
acceptable (and plenty are unacceptable to a greater or lesser extent for
various reasons). It's more a matter of followup. If you don't tell us
enough about what you need so that we can supply a decent answer, we'll
generally ask you for more information (as in this case). If you don't
supply that information, you're not going to learn as much as you'd hoped.
With the possible exception of Chris Torek, people aren't going to give
you a complete treatise on the entire subject just because you weren't
clear about the bit you were interested in. Quote: |
Humility is a virtue, but true humility often seems arrogant.
| Tell me about it. Quote: |
However, this thread has taught me a lot, and I thank all of you.
| You're welcome. But I think you'd have learned more about what you wanted
to learn about, if you'd been clearer about what that actually was.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999 | 
September 4th, 2008, 05:15 AM
| | | Re: detecting ASCII/EBCDIC
On Thu, 04 Sep 2008 04:46:04 +0000, Richard Heathfield
<rjh@see.sig.invalidwrote: Quote:
>Pilcrow said:
> Quote:
>On Thu, 04 Sep 2008 04:22:06 +0000, Richard Heathfield
><rjh@see.sig.invalidwrote:
>> | ><snip> Quote: Quote:
>>>
>>>If you refrain from asking questions from fear of seeming
>>>stupid, you'll never learn, and that would be stupid.
>>>
>>>And if you refrain from asking clear questions from fear of seeming
>>>verbose, you'll never get a clear answer, and that, too, would be stupid.
| >>
>And if I don't know enough to put a question in the acceptable form?
| >
>It's not so much a matter of "the acceptable form" - plenty of forms are
>acceptable (and plenty are unacceptable to a greater or lesser extent for
>various reasons). It's more a matter of followup. If you don't tell us
>enough about what you need so that we can supply a decent answer, we'll
>generally ask you for more information (as in this case). If you don't
>supply that information, you're not going to learn as much as you'd hoped.
>With the possible exception of Chris Torek, people aren't going to give
>you a complete treatise on the entire subject just because you weren't
>clear about the bit you were interested in.
> Quote: |
>Humility is a virtue, but true humility often seems arrogant.
| >
>Tell me about it.
> Quote: |
>However, this thread has taught me a lot, and I thank all of you.
| >
>You're welcome. But I think you'd have learned more about what you wanted
>to learn about, if you'd been clearer about what that actually was.
| Sometimes it's hard to know what you want to know unless you already
know it -- catch 22, y'know.
----
If you refrain from asking questions from fear of seeming
stupid, you'll never learn, and that would be stupid. | 
September 4th, 2008, 06:45 AM
| | | Re: detecting ASCII/EBCDIC
"osmium" <r124c4u102@comcast.netwrote: Quote:
"Eric Sosman" writes:
> Quote:
If the question is restricted to the encoding of the
basic execution set -- the characters that the Standard
requires to be present -- then a straightforward exhaustive
test can determine whether the encoding for those characters
is "consistent with ASCII" or "consistent with EBCDIC" or
"consistent with neither." But is that enough for the O.P.?
Again, yet again, we get back to the question: What is he
*really* trying to find out, and why? (Since the question
has been asked at least four times by at least three people
and has elicited no answer, I'm beginning to think he doesn't
know.)
| >
My guess is that he is one of those annoying (to many of the regulars on
this froup) curious guys who just likes to know things.
>
Pretty pathetic, huh?
| No, he's one of those annoying not-quite-curious-enough guys who doesn't
know _what_ he wants to know, he just likes to ask half-baked questions.
And yes, that's pretty pathetic.
Richard | 
September 4th, 2008, 07:35 AM
| | | Re: detecting ASCII/EBCDIC
On Thu, 04 Sep 2008 06:40:18 GMT, rlb@hoekstra-uitgeverij.nl (Richard
Bos) wrote: Quote:
>"osmium" <r124c4u102@comcast.netwrote:
> Quote:
>"Eric Sosman" writes:
>> Quote:
If the question is restricted to the encoding of the
basic execution set -- the characters that the Standard
requires to be present -- then a straightforward exhaustive
test can determine whether the encoding for those characters
is "consistent with ASCII" or "consistent with EBCDIC" or
"consistent with neither." But is that enough for the O.P.?
Again, yet again, we get back to the question: What is he
*really* trying to find out, and why? (Since the question
has been asked at least four times by at least three people
and has elicited no answer, I'm beginning to think he doesn't
know.)
| >>
>My guess is that he is one of those annoying (to many of the regulars on
>this froup) curious guys who just likes to know things.
>>
>Pretty pathetic, huh?
| >
>No, he's one of those annoying not-quite-curious-enough guys who doesn't
>know _what_ he wants to know, he just likes to ask half-baked questions.
>
>And yes, that's pretty pathetic.
>
>Richard
| Sometimes you don't know what you want to learn until you've learned it.
-- Catch-22.
----
Everybody needs somebody that they can look down on.
If you ain't got noone else, why, help yourself to me. | 
September 4th, 2008, 07:55 AM
| | | Re: detecting ASCII/EBCDIC
"osmium" <r124c4u102@comcast.netwrites: Quote:
"Eric Sosman" writes: Quote:
> If the question is restricted to the encoding of the
>basic execution set -- the characters that the Standard
>requires to be present -- then a straightforward exhaustive
>test can determine whether the encoding for those characters
>is "consistent with ASCII" or "consistent with EBCDIC" or
>"consistent with neither." But is that enough for the O.P.?
>Again, yet again, we get back to the question: What is he
>*really* trying to find out, and why? (Since the question
>has been asked at least four times by at least three people
>and has elicited no answer, I'm beginning to think he doesn't
>know.)
| >
My guess is that he is one of those annoying (to many of the regulars on
this froup) curious guys who just likes to know things.
>
Pretty pathetic, huh?
| No, not at all.
But a question asked for the sake of curiosity might have a different
answer than the very same question asked for the sake of accomplishing
some specific task, so actually telling us why he wants to know could
make it a lot easier for us to provide the answer he wants.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister" | 
September 4th, 2008, 07:55 AM
| | | Re: detecting ASCII/EBCDIC
Pilcrow <pilcrow@pp.infowrites: Quote:
Sometimes you don't know what you want to learn until you've learned it.
-- Catch-22.
| That's why some are asking you the problem you want to solve instead of
giving you 42 different ways of achieving something which could even not be
part of the correct solution.
Yours,
--
Jean-Marc | 
September 4th, 2008, 11:55 AM
| | | Re: detecting ASCII/EBCDIC
Pilcrow wrote: Quote:
On Thu, 04 Sep 2008 06:40:18 GMT, rlb@hoekstra-uitgeverij.nl (Richard
Bos) wrote:
> Quote: |
>"osmium" <r124c4u102@comcast.netwrote:
| | .... Quote: Quote: Quote:
>>My guess is that he is one of those annoying (to many of the regulars on
>>this froup) curious guys who just likes to know things.
>>>
>>Pretty pathetic, huh?
| >No, he's one of those annoying not-quite-curious-enough guys who doesn't
>know _what_ he wants to know, he just likes to ask half-baked questions.
>>
>And yes, that's pretty pathetic.
>>
>Richard
| >
Sometimes you don't know what you want to learn until you've learned it.
| That's why you're being asked about the purpose of your question. No
matter how little you know about a subject, if you are asking questions
about it, you should at least know what your purpose was for asking the
questions. It is, after all, your purpose - if you don't know what it
was, you didn't have one, in which case you wouldn't have bothered asking.
For instance, yesterday my wife (a non-native speaker of English) asked
me what some word (I think it was "eftr") meant. I didn't recognize the
word. so I asked her why she wanted to know. She explained that she was
reading a document which referred to a given strain of bacteria as "EFTR
code 54321" (that is not the actual code). I immediately recognized,
from context, that EFTR was not a word, but an abbreviation for
something (I still don't know what) that assigns codes to bacterial
strains. My wife didn't know what it was she needed to ask, but by
knowing why she wanted to know it, I was able to tell her that she
needed to find out what EFTR was an abbreviation for. | 
September 4th, 2008, 12:35 PM
| | | Re: detecting ASCII/EBCDIC
In article <ln7i9ss679.fsf@nuthaus.mib.org>,
Keith Thompson <kst-u@mib.orgwrote:
.... Yes. Quite. Osmium hit the bullseye here. The regs don't like it. Quote:
>But a question asked for the sake of curiosity might have a different
>answer than the very same question asked for the sake of accomplishing
>some specific task, so actually telling us why he wants to know could
>make it a lot easier for us to provide the answer he wants.
| Blah, blah, blah. | 
September 4th, 2008, 02:45 PM
| | | Re: detecting ASCII/EBCDIC
osmium wrote: Quote:
"Eric Sosman" writes:
> Quote:
> If the question is restricted to the encoding of the
>basic execution set -- the characters that the Standard
>requires to be present -- then a straightforward exhaustive
>test can determine whether the encoding for those characters
>is "consistent with ASCII" or "consistent with EBCDIC" or
>"consistent with neither." But is that enough for the O.P.?
>Again, yet again, we get back to the question: What is he
>*really* trying to find out, and why? (Since the question
>has been asked at least four times by at least three people
>and has elicited no answer, I'm beginning to think he doesn't
>know.)
| >
My guess is that he is one of those annoying (to many of the regulars on
this froup) curious guys who just likes to know things.
>
Pretty pathetic, huh?
| You may find Pilcrow pathetic and annoying, but I don't.
He's groping a bit, exploring an area he doesn't yet quite
understand, that's all. He asked a question that he presumably
thought was simple, and is now learning that the matter is more
complicated than he thought and that the question really didn't
make sense as it stood. That's why I think he "doesn't know:"
he thought he knew, but has learned that he didn't. It's a sort
of Socratic inquiry in reverse.
"When you are a Bear of Very Little Brain, and you think
of Things, you find sometimes that a Thing which seemed
very Thingish inside you is quite different when it gets
out into the open and has other people looking at it."
-- A.A. Milne
-- Eric.Sosman@sun.com | 
September 4th, 2008, 02:55 PM
| | | Re: detecting ASCII/EBCDIC
Eric Sosman said: <snip> Quote: Quote:
>My guess is that he is one of those annoying (to many of the regulars on
>this froup) curious guys who just likes to know things.
>>
>Pretty pathetic, huh?
| >
You may find Pilcrow pathetic and annoying, but I don't.
| I see from your headers that you appear to be using Windows. Fire up
Microsoft Irony, and click the Options menu. On the resulting dialog,
you'll see a Sensitivity control. Drag it a few pixels up. Then click OK.
:-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999 | 
September 4th, 2008, 02:55 PM
| | | Re: detecting ASCII/EBCDIC
"Eric Sosman" wrote: Quote:
osmium wrote: Quote:
>"Eric Sosman" writes:
>> Quote:
>> If the question is restricted to the encoding of the
>>basic execution set -- the characters that the Standard
>>requires to be present -- then a straightforward exhaustive
>>test can determine whether the encoding for those characters
>>is "consistent with ASCII" or "consistent with EBCDIC" or
>>"consistent with neither." But is that enough for the O.P.?
>>Again, yet again, we get back to the question: What is he
>>*really* trying to find out, and why? (Since the question
>>has been asked at least four times by at least three people
>>and has elicited no answer, I'm beginning to think he doesn't
>>know.)
| >>
>My guess is that he is one of those annoying (to many of the regulars on
>this froup) curious guys who just likes to know things.
>>
>Pretty pathetic, huh?
| >
You may find Pilcrow pathetic and annoying, but I don't.
| I'll bet you failed Sarcasm 101. | 
September 4th, 2008, 03:25 PM
| | | Re: detecting ASCII/EBCDIC
osmium wrote: Quote:
"Eric Sosman" wrote:
> Quote:
>osmium wrote: Quote:
>>[...]
>>Pretty pathetic, huh?
| > You may find Pilcrow pathetic and annoying, but I don't.
| >
I'll bet you failed Sarcasm 101.
| No, I passed by finding a web site with all the test answers
and memorizing them. ;-)
Your "Pretty pathetic, huh?" was easy to recognize as sarcasm,
but the target thereof was less than clear. If you want to say
something without risking misunderstanding, learn to aim better
than Dick Cheney.
-- Eric.Sosman@sun.com | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 220,989 network members.
|