www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - First steps

reply Gabor Deak Jahn <djg tramontana.co.hu> writes:
Hello,

excuse me for dropping in with a simple question like this
but I searched the FAQ and any available resources and I
was unable to find an answer.

I read the D description and found the language rather
interesting and sane, I just wish Stroustrup had the same
expertise when he designed C++ in the first place. I'm
currently using many languages, C, C++, C#, Pascal and I'm
contemplating to write my next major project in D to see
how it works out in real life.

My first test programs compile and run all right (Windows
XP), except for one silly error. As soon as I start using
comments (either //, /* or /+), I start getting 'invalid
UTF-8 sequence' errors. The source file is plain ASCII but
it doesn't make any difference if I change it to UTF-
anything. The compiler version is v0.172, I've freshly
downloaded it a couple of weeks ago from here.

PS: the forum doesn't work with Opera. With an out-of-
mainstream (yet) language like D, shouldn't we strive to
serve out-of-mainstream (yet) browsers as well? :-)))

Thanks,
  Gabor
Nov 22 2006
next sibling parent reply "Kristian Kilpi" <kjkilpi gmail.com> writes:
On Wed, 22 Nov 2006 14:58:57 +0200, Gabor Deak Jahn <djg tramontana.co.hu>  
wrote:

 Hello,

 excuse me for dropping in with a simple question like this
 but I searched the FAQ and any available resources and I
 was unable to find an answer.

 I read the D description and found the language rather
 interesting and sane, I just wish Stroustrup had the same
 expertise when he designed C++ in the first place. I'm
 currently using many languages, C, C++, C#, Pascal and I'm
 contemplating to write my next major project in D to see
 how it works out in real life.

 My first test programs compile and run all right (Windows
 XP), except for one silly error. As soon as I start using
 comments (either //, /* or /+), I start getting 'invalid
 UTF-8 sequence' errors. The source file is plain ASCII but
 it doesn't make any difference if I change it to UTF-
 anything. The compiler version is v0.172, I've freshly
 downloaded it a couple of weeks ago from here.

 PS: the forum doesn't work with Opera. With an out-of-
 mainstream (yet) language like D, shouldn't we strive to
 serve out-of-mainstream (yet) browsers as well? :-)))

 Thanks,
   Gabor

All the comments must also contain plain ASCII only. For example, scandinavian letters (, , ) cannot be used inside comments. Btw, I am using Opera, and at the first glance the forums seems to work. I did have a couple of problems to connect to the newsgroup server though. It took a quite long time before the newgroups available on the server were listed (so that I could subscribe to them). But maybe it was just common lag.
Nov 22 2006
parent reply "JohnC" <johnch_atms hotmail.com> writes:
"Kristian Kilpi" <kjkilpi gmail.com> wrote in message 
news:op.tjfefqr4usumhd mist...
 On Wed, 22 Nov 2006 14:58:57 +0200, Gabor Deak Jahn <djg tramontana.co.hu> 
 wrote:

 Hello,

 excuse me for dropping in with a simple question like this
 but I searched the FAQ and any available resources and I
 was unable to find an answer.

 I read the D description and found the language rather
 interesting and sane, I just wish Stroustrup had the same
 expertise when he designed C++ in the first place. I'm
 currently using many languages, C, C++, C#, Pascal and I'm
 contemplating to write my next major project in D to see
 how it works out in real life.

 My first test programs compile and run all right (Windows
 XP), except for one silly error. As soon as I start using
 comments (either //, /* or /+), I start getting 'invalid
 UTF-8 sequence' errors. The source file is plain ASCII but
 it doesn't make any difference if I change it to UTF-
 anything. The compiler version is v0.172, I've freshly
 downloaded it a couple of weeks ago from here.

 PS: the forum doesn't work with Opera. With an out-of-
 mainstream (yet) language like D, shouldn't we strive to
 serve out-of-mainstream (yet) browsers as well? :-)))

 Thanks,
   Gabor

All the comments must also contain plain ASCII only. For example, scandinavian letters (, , ) cannot be used inside comments. Btw, I am using Opera, and at the first glance the forums seems to work. I did have a couple of problems to connect to the newsgroup server though. It took a quite long time before the newgroups available on the server were listed (so that I could subscribe to them). But maybe it was just common lag.

D accepts UTF source files - http://www.digitalmars.com/d/lex.html Set your editor's encoding as UTF8 to preserve non-ASCII characters. Even humble old Notepad can do this.
Nov 22 2006
parent reply "Kristian Kilpi" <kjkilpi gmail.com> writes:
On Wed, 22 Nov 2006 18:50:51 +0200, JohnC <johnch_atms hotmail.com> wrote:

 "Kristian Kilpi" <kjkilpi gmail.com> wrote in message
 news:op.tjfefqr4usumhd mist...
 On Wed, 22 Nov 2006 14:58:57 +0200, Gabor Deak Jahn  
 <djg tramontana.co.hu>
 wrote:

 Hello,

 excuse me for dropping in with a simple question like this
 but I searched the FAQ and any available resources and I
 was unable to find an answer.

 I read the D description and found the language rather
 interesting and sane, I just wish Stroustrup had the same
 expertise when he designed C++ in the first place. I'm
 currently using many languages, C, C++, C#, Pascal and I'm
 contemplating to write my next major project in D to see
 how it works out in real life.

 My first test programs compile and run all right (Windows
 XP), except for one silly error. As soon as I start using
 comments (either //, /* or /+), I start getting 'invalid
 UTF-8 sequence' errors. The source file is plain ASCII but
 it doesn't make any difference if I change it to UTF-
 anything. The compiler version is v0.172, I've freshly
 downloaded it a couple of weeks ago from here.

 PS: the forum doesn't work with Opera. With an out-of-
 mainstream (yet) language like D, shouldn't we strive to
 serve out-of-mainstream (yet) browsers as well? :-)))

 Thanks,
   Gabor

All the comments must also contain plain ASCII only. For example, scandinavian letters (, , ) cannot be used inside comments. Btw, I am using Opera, and at the first glance the forums seems to work. I did have a couple of problems to connect to the newsgroup server though. It took a quite long time before the newgroups available on the server were listed (so that I could subscribe to them). But maybe it was just common lag.

D accepts UTF source files - http://www.digitalmars.com/d/lex.html Set your editor's encoding as UTF8 to preserve non-ASCII characters. Even humble old Notepad can do this.

Doh! I'm so stick with ASCII, that UTF scares me! :) But yeah, that's good to know.
Nov 22 2006
parent reply Hasan Aljudy <hasan.aljudy gmail.com> writes:
Kristian Kilpi wrote:
 On Wed, 22 Nov 2006 18:50:51 +0200, JohnC <johnch_atms hotmail.com> wrote:
 
 "Kristian Kilpi" <kjkilpi gmail.com> wrote in message
 news:op.tjfefqr4usumhd mist...
 On Wed, 22 Nov 2006 14:58:57 +0200, Gabor Deak Jahn 
 <djg tramontana.co.hu>
 wrote:

 Hello,

 excuse me for dropping in with a simple question like this
 but I searched the FAQ and any available resources and I
 was unable to find an answer.

 I read the D description and found the language rather
 interesting and sane, I just wish Stroustrup had the same
 expertise when he designed C++ in the first place. I'm
 currently using many languages, C, C++, C#, Pascal and I'm
 contemplating to write my next major project in D to see
 how it works out in real life.

 My first test programs compile and run all right (Windows
 XP), except for one silly error. As soon as I start using
 comments (either //, /* or /+), I start getting 'invalid
 UTF-8 sequence' errors. The source file is plain ASCII but
 it doesn't make any difference if I change it to UTF-
 anything. The compiler version is v0.172, I've freshly
 downloaded it a couple of weeks ago from here.

 PS: the forum doesn't work with Opera. With an out-of-
 mainstream (yet) language like D, shouldn't we strive to
 serve out-of-mainstream (yet) browsers as well? :-)))

 Thanks,
   Gabor

All the comments must also contain plain ASCII only. For example, scandinavian letters (, , ) cannot be used inside comments. Btw, I am using Opera, and at the first glance the forums seems to work. I did have a couple of problems to connect to the newsgroup server though. It took a quite long time before the newgroups available on the server were listed (so that I could subscribe to them). But maybe it was just common lag.

D accepts UTF source files - http://www.digitalmars.com/d/lex.html Set your editor's encoding as UTF8 to preserve non-ASCII characters. Even humble old Notepad can do this.

Doh! I'm so stick with ASCII, that UTF scares me! :) But yeah, that's good to know.

UTF sorta scared me when I didn't know anything about it. I wasn't stuck with ASCII, I couldn't have been, becuase I write and read Arabic text all the time. I was stuck with Code Page 1256. but nah, code pages are crap. UTF rocks!
Nov 22 2006
parent Walter Bright <newshound digitalmars.com> writes:
Hasan Aljudy wrote:
 but nah, code pages are crap. UTF rocks!

Code pages are so Windows 95 <g>.
Nov 23 2006
prev sibling next sibling parent reply Boris Kolar <boris.kolar globera.com> writes:
== Quote from Gabor Deak Jahn (djg tramontana.co.hu)'s article
 My first test programs compile and run all right (Windows
 XP), except for one silly error. As soon as I start using
 comments (either //, /* or /+), I start getting 'invalid
 UTF-8 sequence' errors. The source file is plain ASCII but
 it doesn't make any difference if I change it to UTF-
 anything.

Try with a different editor. Code::Blocks works for me. If you still have problems, look at your source code with hex editor and see if there are any strange sequences.
Nov 22 2006
parent reply %u <djg tramontana.co.hu> writes:
I have no accented letters in the comments (although I might need them in some
places, I always write
comments in English but my company name has accented letters so the header
comment at the beginning
of the file might have accents).

I get UTF-8 errors even if I put nothing in comments, just place a // on a line
of its own anywhere. This is
not a problem of editors, I use a plain and simple ASCII (although UTF-capable)
editor, also checked the
hex values, there is nothing wrong with the source file but error messages. So,
again, plain ASCII file, no
BOM or any other sequence up front, starts with // and the compiler stops with
an error.

As far as Opera is concerned, I hven't tried to use it as a newsgroup, just
followed the link from the Digital
Mars home page to the forum and the Post link in the lower right corner doesn't
work. Interestingly, the
Reply at the bottom of a message already does, so I already can type this
message in Opera, only I
couldn't initiate the thread. Some JavaScript programming error, I suppose.

Bye,
  Gbor
Nov 23 2006
next sibling parent reply Derek Parnell <derek psych.ward> writes:
On Thu, 23 Nov 2006 11:29:35 +0000 (UTC), %u wrote:

 I have no accented letters in the comments (although I might need them in some
places, I always write
 comments in English but my company name has accented letters so the header
comment at the beginning
 of the file might have accents).
 
 I get UTF-8 errors even if I put nothing in comments, just place a // on a
line of its own anywhere. This is
 not a problem of editors, I use a plain and simple ASCII (although
UTF-capable) editor, also checked the
 hex values, there is nothing wrong with the source file but error messages.
So, again, plain ASCII file, no
 BOM or any other sequence up front, starts with // and the compiler stops with
an error.

Show us the smallest program code that this effect happens with. That way we can see what you are talking about and test it independantly. -- Derek
Nov 23 2006
parent reply Gbor DEK JAHN <djg tramontana.co.hu> writes:
Not any more because finally it started to work. I had to convert all my source
files to UTF-8 and it works now. Earlier I only converted
one of those into various notational flavors and kept getting the messages. Now
that everything is UTF-8, it works all right.

Sorry for the false alarm and thank you for your help.

By the way, if I could suggest one thing: if the compiler would return both a
line and column numbers instead of just a line number
with the error messages (I know that this can be pretty hard sometimes, I wrote
compilers myself and know the problems associated
with parsing and error reporting), that could have pinpointed my problem
earlier, pointing right to the offending accented letter.

Thanks,
  Gbor
Nov 23 2006
parent reply Hasan Aljudy <hasan.aljudy gmail.com> writes:
Gbor DEK JAHN wrote:
 Not any more because finally it started to work. I had to convert all my
source files to UTF-8 and it works now. Earlier I only converted
 one of those into various notational flavors and kept getting the messages.
Now that everything is UTF-8, it works all right.
 
 Sorry for the false alarm and thank you for your help.
 
 By the way, if I could suggest one thing: if the compiler would return both a
line and column numbers instead of just a line number
 with the error messages (I know that this can be pretty hard sometimes, I
wrote compilers myself and know the problems associated
 with parsing and error reporting), that could have pinpointed my problem
earlier, pointing right to the offending accented letter.
 
 Thanks,
   Gbor

Yea, and your name now displays correctly in Thunderbird. In your previous reply, it was "G?bor".
Nov 23 2006
parent Alexander Panek <a.panek brainsware.org> writes:
I have UTF-8 and it worked before perfectly fine..not it's G<?><?><?>~ 
etc... scary!


Hasan Aljudy wrote:
 
 
 Gbor DEK JAHN wrote:
 Not any more because finally it started to work. I had to convert all 
 my source files to UTF-8 and it works now. Earlier I only converted
 one of those into various notational flavors and kept getting the 
 messages. Now that everything is UTF-8, it works all right.

 Sorry for the false alarm and thank you for your help.

 By the way, if I could suggest one thing: if the compiler would return 
 both a line and column numbers instead of just a line number
 with the error messages (I know that this can be pretty hard 
 sometimes, I wrote compilers myself and know the problems associated
 with parsing and error reporting), that could have pinpointed my 
 problem earlier, pointing right to the offending accented letter.

 Thanks,
   Gbor

Yea, and your name now displays correctly in Thunderbird. In your previous reply, it was "G?bor".

Nov 23 2006
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

%u schrieb am 2006-11-23:
 I have no accented letters in the comments (although I might need them in some
places, I always write
 comments in English but my company name has accented letters so the header
comment at the beginning
 of the file might have accents).

 I get UTF-8 errors even if I put nothing in comments, just place a // on a
line of its own anywhere. This is
 not a problem of editors, I use a plain and simple ASCII (although
UTF-capable) editor, also checked the
 hex values, there is nothing wrong with the source file but error messages.
So, again, plain ASCII file, no
 BOM or any other sequence up front, starts with // and the compiler stops with
an error.

Can you please zip(to ensure that no "magic" transcoding occures) a sample source and send it to this newsgroup? Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFZdWFLK5blCcjpWoRAgn5AJ4qtermlSutb/IpQIzhGpWgdK9MhQCeIhZZ igCu+gyxtA1bd6XviplHRtQ= =HOrr -----END PGP SIGNATURE-----
Nov 23 2006
prev sibling parent "John Reimer" <terminal.node gmail.com> writes:
On Wed, 22 Nov 2006 04:58:57 -0800, Gabor Deak Jahn <djg tramontana.co.hu>  
wrote:

 PS: the forum doesn't work with Opera. With an out-of-
 mainstream (yet) language like D, shouldn't we strive to
 serve out-of-mainstream (yet) browsers as well? :-)))

I'm using opera for this newsgroup, and it works fine. It didn't initially for some odd reason. I can't remember how exactly I got it working, but I think I had to enable the newsgroup indirectly by clicking on a newsgroup link causing Opera to add it to the newsreader automatically. Then the groups showed up. Strange. In short, I think it's a problem with Opera. -JJR
Nov 22 2006