Why this works???

R

Richard

Actually, every time I post this sort of thing (which is my stock sort
of response to idiotic "Why this works?" type posts), I forget about the
need for a "return 0;" at the end (actually testing my code with gcc
with all warnings turned on would have shown this up).

Still, I have to ask this: The C standard of course says that once UB
happens, all bets are off. And, let's assume for the sake of argument
that the above program does cause UB. But the point is, it doesn't
cause the UB until the function returns. I.e., the statement above is
"... once UB happens". But it is not the case that future UB can cause
current operations to fail. So, the above program would (under all the
usual CLC rules) work, as far as printing "hello, world", even though it
might start global thermonuclear war thereafter.

Doesn't UB make Heathfield's toaster play the star spangled banner and
then insult Muslims? Oh. I see the link.
 
H

Harald van Dijk

Harald, how do you write your own name for Usenet? It comes up as the
following on my newsreader:

=?UTF-8?q?Harald_van_D=C4=B3k?=

It's not that I'm too lazy to sort the problem out, it's just that I
don't know how to get my newsreader to use UTF-8 properly.

Unfortunately, for message headers, your newsreader can't use UTF-8 (or
any other non-ASCII encoding) properly, as Xnews simply doesn't seem to
support RFC 1522, which is the mechanism for including non-ASCII text in
headers. You would be able to properly send messages if you either use
the nearest ASCII rendition of your name, or if you manually encode your
name (one possible encoding would be =?ISO-8859-1?q?
Tom=E1s_=D3_h=C9ilidhe?=, if I haven't messed that up), but then you
would be unable to see your own name yourself.

Other newsreaders encode and decode message headers automatically,
meaning you can enter your name exactly the way you did in Xnews, and the
newsreader takes care of it. I don't know if you're willing to try out
other newsreaders, but if you are, you could take a look at pan (that's
what I'm using), or Mozilla Thunderbird. I believe both handle encoded
headers well.
 
T

Tomás Ó hÉilidhe

Unfortunately, for message headers, your newsreader can't use UTF-8
(or any other non-ASCII encoding) properly, as Xnews simply doesn't
seem to support RFC 1522, which is the mechanism for including
non-ASCII text in headers. You would be able to properly send messages
if you either use the nearest ASCII rendition of your name, or if you
manually encode your name (one possible encoding would be
=?ISO-8859-1?q? Tom=E1s_=D3_h=C9ilidhe?=, if I haven't messed that
up), but then you would be unable to see your own name yourself.


Thank you kindly for that. I'm after using it in my name on this post.
Can people please reply and tell me whether my name looks OK on their
newsreader?

I don't use the nearest ASCII rendition of my name because it's a
slippery slope once you start letting people leave the diacritics out of
the spelling of your name.

Other newsreaders encode and decode message headers automatically,
meaning you can enter your name exactly the way you did in Xnews, and
the newsreader takes care of it. I don't know if you're willing to try
out other newsreaders, but if you are, you could take a look at pan
(that's what I'm using), or Mozilla Thunderbird. I believe both handle
encoded headers well.


I tried Pan for a week or so, couldn't stand it. Without Xnews, I don't
think I'd be on Usenet at all.

(By the way, doesn't my signature look OK?)
 
M

Mark McIntyre

� said:
Thank you kindly for that. I'm after using it in my name on this post.
Can people please reply and tell me whether my name looks OK on their
newsreader?

In thunderbird, your name in the headers appears as a questionmark
inside a black hexagon... your signature has a capital-E-acute as the
2nd letter of your surname.
 
D

Dave Null

Thank you kindly for that. I'm after using it in my name on this post.
Can people please reply and tell me whether my name looks OK on their
newsreader?

I don't use the nearest ASCII rendition of my name because it's a
slippery slope once you start letting people leave the diacritics out of
the spelling of your name.

Who gives a toss about your stupid name or fucking diacritical marks ....
you're name is near as damn it Thomas, which will do for me.

Please discuss C or **** off. I've learned huge amounts here over the last
few months andI may one day feel that I know enough to understand lots of
what's said - my thanks, therefore, to those who have helped me to adopt
compliant techniques and to write code that does what I want it to on my
simple level, and who will no doubt push me in the appropriate directions
when I, inevitably, ask for guidance.
---- Posted via Pronews.com - Premium Corporate Usenet News Provider ----
http://www.pronews.com offers corporate packages that have access to 100,000+ newsgroups
 
H

Harald van Dijk

Thank you kindly for that. I'm after using it in my name on this post.
Can people please reply and tell me whether my name looks OK on their
newsreader?

You're using "=?UTF-8?..." rather than "=?ISO-8859-1?..." for your
encoded name. You can encode your name in UTF-8 if you want, but you
can't use the ISO-8859-1 encoding and then say it's UTF-8. pan displays
your encoded name in the message view, and replaces the invalid UTF-8
sequences with question marks in this reply.
I don't use the nearest ASCII rendition of my name because it's a
slippery slope once you start letting people leave the diacritics out of
the spelling of your name.
Understandable.

I tried Pan for a week or so, couldn't stand it. Without Xnews, I don't
think I'd be on Usenet at all.

Fair enough.
(By the way, doesn't my signature look OK?)

Your headers don't specify a character set for your message, which again
implies the default value of us-ascii, but I don't know if this too
actually causes problems for people reading this group. pan displays it
as you intended.
 
J

Joachim Schmitz

Toms hilidhe said:
Thank you kindly for that. I'm after using it in my name on this post.
Can people please reply and tell me whether my name looks OK on their
newsreader?

I don't use the nearest ASCII rendition of my name because it's a
slippery slope once you start letting people leave the diacritics out of
the spelling of your name.
Dosn't look OK to me (in Outloock Express), looked better before.
Harald's one doesn't look right either, I see a ? instead of the ij
I tried Pan for a week or so, couldn't stand it. Without Xnews, I don't
think I'd be on Usenet at all.

(By the way, doesn't my signature look OK?)
Looks OK to me. Strange, but OK :cool:

By, Jojo
 
J

Johannes Bauer

Dave said:
Who gives a toss about your stupid name or fucking diacritical marks ....
you're name is near as damn it Thomas, which will do for me.

Whoa, you just won the Jerk of the Month award, Doris (close enough to
"Dave" for me).

Without greetings,
Johannes
 
T

Tomás Ó hÉilidhe

=?UTF-8?q?Harald_van_D=C4=B3k?=:
You're using "=?UTF-8?..." rather than "=?ISO-8859-1?..." for your
encoded name. You can encode your name in UTF-8 if you want, but you
can't use the ISO-8859-1 encoding and then say it's UTF-8. pan
displays
your encoded name in the message view, and replaces the invalid UTF-8
sequences with question marks in this reply.


I did a Google for "UTF-8 table" and copied the hexadecimal values. (In
fact I didn't have to copy them because they were identical to the ones
you gave me for ISO-8859-1).

I've changed my header again to see if it displays properly, so could
people please reply and say whether it came out OK? Without diacritics,
it should be:

Tomas O hEilidhe

however there's an acute accent over the a, the uppercase O and the
uppercase E.

Your headers don't specify a character set for your message, which
again implies the default value of us-ascii, but I don't know if this
too actually causes problems for people reading this group. pan
displays it as you intended.


I've changed my headers to specify ISO-8859-1. Could people please reply
saying whether both my name and my signature are coming out right?
 
T

Tomás Ó hÉilidhe

I've changed my headers to specify ISO-8859-1. Could people please reply
saying whether both my name and my signature are coming out right?


Christ I'm an idiot I didn't save the changes.

Here's my second attempt.
 
H

Harald van Dijk

Christ I'm an idiot I didn't save the changes.

Here's my second attempt.

Your name is coming up right in your signature and in this reply, but it
appears encoded in the thread list in pan. However, I believe you've done
the best you reasonably can with your newsreader, so thank you.
 
J

Joachim Schmitz

Dave Null said:
Who gives a toss about your stupid name or fucking diacritical marks ....
you're name is near as damn it Thomas, which will do for me.

Please discuss C or **** off.
While you're right that this is off topic here, your behavoir and manners
are completly unacceptable and you own an apology.

Bye, Jojo
 
T

Tomás Ó hÉilidhe

Thank you all for your help. If my name still comes up as gobbildy gook
on anyone's machine then please feel free to e-mail and I'll do what I can
to get it working right. We can then use alt.test to get it right.

Just a question or two tho before I finally put this to rest:

* I understand that the headers must only contain ASCII characters, which
is why I'm using the following format for my name:

equals questionmark CHARSET question mark TEXT questionmark equals

I'd like to ask about the *content* of the post though. Should I:
A) Specify iso-8859-1 as the character set, and then just send it as normal
with all the extended characters in all their glory.
or
B) Specify us-ascii as the character set, and then use the equals
questionmark thing in my signature again. (Is this even allowed?)


Is ISO-8859-1 well-supported? Should my name show up correctly on the vast
majority of modern machines?

My preference would be to use UTF-8. Given that UTF-8 is a variable-length
character encoding scheme, that would of course mean that my newsreader
would need to have special support for it. Since XNews doesn't support
variable-length encoding, I should take the next best option which is to
choose the 8-bit mono-length character set that is most widely supported in
the world. Would ISO-8859-1 be that charset?

I think I've finally got my headers and content right :-D
 
T

Tomás Ó hÉilidhe

Joachim Schmitz:
While you're right that this is off topic here, your behavoir and
manners are completly unacceptable and you own an apology.


Thank you for the sentiment Joachim, but I have a personal policy of
ignoring posts that don't tickle my fancy. The person posting as "Dave
Null" is a coward, and I've no interest in conversing with them or even
acknowledging his existence.

Thank you again, but please ignore the cowards in future. We do have a
price to pay for using unmoderated groups, but that price is drastically
minimised if we simply ignore the posts that deserve to be ignored.
 
T

Tomás Ó hÉilidhe

Tomás Ó hÉilidhe:
Joachim Schmitz:



Thank you for the sentiment Joachim, but I have a personal policy of
ignoring posts that don't tickle my fancy. The person posting as "Dave
Null" is a coward, and I've no interest in conversing with them or even
acknowledging his existence.


Wups, that second last word, "his", should have been "their". (Or perhaps
"his/her" depending on your dialect).
 
H

Harald van Dijk

Thank you all for your help. If my name still comes up as gobbildy gook
on anyone's machine then please feel free to e-mail and I'll do what I
can to get it working right. We can then use alt.test to get it right.

Just a question or two tho before I finally put this to rest:

* I understand that the headers must only contain ASCII characters,
which is why I'm using the following format for my name:

equals questionmark CHARSET question mark TEXT questionmark equals

You forgot the ?q?. The short description is

=?charset?encoding?text?=
I'd like to ask about the *content* of the post though. Should I: A)
Specify iso-8859-1 as the character set, and then just send it as normal
with all the extended characters in all their glory.
Yes.

or
B) Specify us-ascii as the character set, and then use the equals
questionmark thing in my signature again. (Is this even allowed?)

It's possible that there are ways to make that work, but simply
specifying us-ascii as the encoding isn't enough, because then the = will
be treated as a literal =. Additionally, if you go that route with a
newsreader that doesn't support MIME, it would mean that you can't type =
in normal text anymore. That's not useful if you intend to post C code to
this group.
Is ISO-8859-1 well-supported?
Absolutely.

Should my name show up correctly on the
vast majority of modern machines?

It should show up correctly on more machines than any other header format
you can convince Xnews to send out.
My preference would be to use UTF-8. Given that UTF-8 is a
variable-length character encoding scheme, that would of course mean
that my newsreader would need to have special support for it. Since
XNews doesn't support variable-length encoding, I should take the next
best option which is to choose the 8-bit mono-length character set that
is most widely supported in the world. Would ISO-8859-1 be that charset?

Yes, but more important is that you use a character set that supports the
characters you want to send, which luckily also happens to be that same
charset.
 
C

Coos Haak

Op Sat, 12 Jan 2008 21:07:03 GMT schreef Tomás Ó hÉilidhe:
Thank you all for your help. If my name still comes up as gobbildy gook
on anyone's machine then please feel free to e-mail and I'll do what I can
to get it working right. We can then use alt.test to get it right.

Just a question or two tho before I finally put this to rest:

* I understand that the headers must only contain ASCII characters, which
is why I'm using the following format for my name:

equals questionmark CHARSET question mark TEXT questionmark equals

I'd like to ask about the *content* of the post though. Should I:
A) Specify iso-8859-1 as the character set, and then just send it as normal
with all the extended characters in all their glory.
I think that's the reason the bodies show up in may reader just like the
ones of other posters. Not more widers spaced as before. I like it.
Just a question, what is the origin of your name, I've never seen names in
CamelCase ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top