Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: detecting ASCII/EBCDIC

Reply
Thread Tools

Re: detecting ASCII/EBCDIC

 
 
Jean-Marc Bourguet
Guest
Posts: n/a
 
      09-03-2008
Eric Sosman <(E-Mail Removed)> writes:

> Pilcrow wrote:
> > On Tue, 02 Sep 2008 15:11:49 -0700, Pilcrow <(E-Mail Removed)> wrote:
> >
> >> 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
 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      09-04-2008
"Eric Sosman" writes:

> 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?



 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      09-04-2008
"osmium" <(E-Mail Removed)> wrote:

> "Eric Sosman" writes:
>
> > 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
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      09-04-2008
"osmium" <(E-Mail Removed)> writes:
> "Eric Sosman" writes:
>> 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) http://www.velocityreviews.com/forums/(E-Mail Removed) <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"
 
Reply With Quote
 
Jean-Marc Bourguet
Guest
Posts: n/a
 
      09-04-2008
Pilcrow <(E-Mail Removed)> writes:

> 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
 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      09-04-2008
Pilcrow wrote:
> On Thu, 04 Sep 2008 06:40:18 GMT, (E-Mail Removed) (Richard
> Bos) wrote:
>
>> "osmium" <(E-Mail Removed)> wrote:

....
>>> 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.
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      09-04-2008
In article <(E-Mail Removed)>,
Keith Thompson <(E-Mail Removed)> wrote:
....
>No, not at all.


Yes. Quite. Osmium hit the bullseye here. The regs don't like it.

>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.

 
Reply With Quote
 
osmium
Guest
Posts: n/a
 
      09-04-2008
"Eric Sosman" wrote:

> osmium wrote:
>> "Eric Sosman" writes:
>>
>>> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting end of file for VHDL'93 Gary Thorpe VHDL 2 07-12-2005 07:42 AM
Detecting if Mozilla is Running Peter Firefox 1 04-30-2005 09:47 PM
Detecting edge in a clock synchronous porcess Praveen VHDL 2 04-12-2005 11:36 AM
Detecting of 'U' in a std_logic_vector Thomas Reinemann VHDL 4 11-03-2004 08:24 AM
detecting if program is running under X windows or not Paul Faulstich Perl 1 01-10-2004 07:16 PM



Advertisments