Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - UTF-8 problems with windows

 
Thread Tools Search this Thread
Old 08-12-2009, 02:43 PM   #11
Default Re: UTF-8 problems with windows


Mike Schilling wrote:
> And I'd add:
> NullPointerExceptions in a language that insists it doesn't have
> pointers.


What language is that? Not Java.

Java certainly does not "insist" that it doesn't have pointers. Java most
assuredly does have pointers. There is even an index entry in the JLS for
"pointers" and the JLS uses the term in §4.3.1
> The reference values (often just references) are pointers to these objects ...


§6.8.7
> ... as in buf holding a pointer to a buffer of some kind ...


§15.13.2
> ... the check for a null pointer ...


and, of course, the dozens of references in the JLS to 'NullPointerException'
itself.

That is averring that that language has pointers, the exact opposite of
"insist[ing] it doesn't have pointers". Heck, it's practically shouting to
anyone who will listen that the language does have pointers.

I don't know how this canard that Java doesn't have pointers ever got started.

--
Lew


Lew
  Reply With Quote
Old 08-12-2009, 03:06 PM   #12
Alan Morgan
 
Posts: n/a
Default Re: UTF-8 problems with windows
In article <h5ugug$5fn$>, Lew <> wrote:
>Mike Schilling wrote:
>> And I'd add:
>> NullPointerExceptions in a language that insists it doesn't have
>> pointers.

>
>What language is that? Not Java.
>
>Java certainly does not "insist" that it doesn't have pointers. Java most
>assuredly does have pointers. There is even an index entry in the JLS for
>"pointers" and the JLS uses the term in §4.3.1


Java doesn't have explicit pointers. Java has references that are
implemented using pointers (but what language doesn't have some feature
implemented using pointers?).

The NullPointerException is more like a NullReferenceException. I note
that the JLS says "Integer operators can throw a NullPointerException if
unboxing conversion of a null reference is required".

Also, the JLS talks about types and mentions primitive types and reference
types (where pointeres are mentioned), but doesn't mention pointer types
anywhere (and, in the index, for "pointers" it says "see references").
Almost every mention of "pointer" in that doc is in the context of
NullPointerException.

One could be forgiven for thinking that pointers are an implementation
detail and not part of the language proper.

[snipped references, heh, to pointers]
>I don't know how this canard that Java doesn't have pointers ever got started.


Probably from Java programmers and various *other* bits of documentation
like http://www.j2ee.me/docs/white/langenv/Simple.doc2.html

which says "You no longer have dangling pointers and trashing of memory
because of incorrect pointers, because there are no pointers in Java".

Alan
--
Defendit numerus


Alan Morgan
  Reply With Quote
Old 08-12-2009, 03:18 PM   #13
Lew
 
Posts: n/a
Default Re: UTF-8 problems with windows
Alan Morgan wrote:
> In article <h5ugug$5fn$>, Lew <> wrote:
>> Mike Schilling wrote:
>>> And I'd add:
>>> NullPointerExceptions in a language that insists it doesn't have
>>> pointers.

>> What language is that? Not Java.
>>
>> Java certainly does not "insist" that it doesn't have pointers. Java most
>> assuredly does have pointers. There is even an index entry in the JLS for
>> "pointers" and the JLS uses the term in §4.3.1

>
> Java doesn't have explicit pointers. Java has references that are
> implemented using pointers (but what language doesn't have some feature
> implemented using pointers?).


That's not what the JLS says. The JLS says that references *are* pointers.
It is not a question of implementation but of language definition. Your
discussion of implementation is by the wayside.

> The NullPointerException is more like a NullReferenceException. I note


The terms are synonymous, according to the JLS.

> that the JLS says "Integer operators can throw a NullPointerException if
> unboxing conversion of a null reference is required".


Yes, because the pointer might be null.

> Also, the JLS talks about types and mentions primitive types and reference
> types (where pointeres are mentioned), but doesn't mention pointer types
> anywhere (and, in the index, for "pointers" it says "see references").


Again, because according to the JLS references are pointers. Why did you
elide that quote from your response?

> Almost every mention of "pointer" in that doc is in the context of
> NullPointerException.


So? (Note that you say "almost" - that only counts in horseshoes and hand
grenades.)

> One could be forgiven for thinking that pointers are an implementation
> detail and not part of the language proper.


Why? It's not accurate to think that.

> [snipped references, heh, to pointers]
>> I don't know how this canard that Java doesn't have pointers ever got started.

>
> Probably from Java programmers and various *other* bits of documentation
> like http://www.j2ee.me/docs/white/langenv/Simple.doc2.html
> which says "You no longer have dangling pointers and trashing of memory
> because of incorrect pointers, because there are no pointers in Java".


The statement "a language that insists it doesn't have pointers", and the
question at large of whether the language has a feature, is handled by
reference to the definition of the language itself, i.e., the JLS, which
clearly states that the language does have pointers, not by reference to some
mistaken writer's wrong statements in a non-normative document at a
non-authoritative site. Showing that the canard has started as you just did
does not answer the question of how it got started.

The JLS states outright that the Java language has pointers, as a language and
without regard for its implementation. The JLS is the definition of the Java
language, ergo the conclusion is definitive.

--
Lew


Lew
  Reply With Quote
Old 08-12-2009, 07:01 PM   #14
Roedy Green
 
Posts: n/a
Default Re: UTF-8 problems with windows
On Tue, 11 Aug 2009 12:25:17 +0200, Michael Jung
<> wrote, quoted or indirectly quoted someone
who said :

>I used to have new PrintWriter(os), but wanted to enforce the encoding
>and PrintWriter doesn't take one. *That* would be a convenience
>constructor needed.


PrintWriter constructor has a csn parameter ( char set/encodingh
parameter)

see http://mindprod.com/applet/fileio.html
for sample code.

--
Roedy Green Canadian Mind Products
http://mindprod.com

"You can have quality software, or you can have pointer arithmetic; but you cannot have both at the same time."
~ Bertrand Meyer (born: 1950 age: 59) 1989, creator of design by contract and the Eiffel language.


Roedy Green
  Reply With Quote
Old 08-12-2009, 07:06 PM   #15
Roedy Green
 
Posts: n/a
Default Re: UTF-8 problems with windows
On Wed, 12 Aug 2009 09:43:43 -0400, Lew <> wrote,
quoted or indirectly quoted someone who said :

>
>I don't know how this canard that Java doesn't have pointers ever got started.


Go back to Java 1.0. Almost every day some C++ programmer would ask,
"How could you write any serious code without pointers?"

There someone would explain there were pointers, just were called
"references" to distinguish them from C++'s wild pointers because they
had some safety features like no pointer arithmetic, and no pointing
into the middle of objects.


--
Roedy Green Canadian Mind Products
http://mindprod.com

"You can have quality software, or you can have pointer arithmetic; but you cannot have both at the same time."
~ Bertrand Meyer (born: 1950 age: 59) 1989, creator of design by contract and the Eiffel language.


Roedy Green
  Reply With Quote
Old 08-12-2009, 09:08 PM   #16
Michael Jung
 
Posts: n/a
Default Re: UTF-8 problems with windows
Roedy Green <> writes:
> On Tue, 11 Aug 2009 12:25:17 +0200, Michael Jung wrote:

[...]
>>I used to have new PrintWriter(os), but wanted to enforce the encoding
>>and PrintWriter doesn't take one. *That* would be a convenience
>>constructor needed.


> PrintWriter constructor has a csn parameter ( char set/encodingh
> parameter)


You know that that one is meaningless in the context the question
arose in?

Michael


Michael Jung
  Reply With Quote
Old 08-12-2009, 10:17 PM   #17
Roedy Green
 
Posts: n/a
Default Re: UTF-8 problems with windows
On Wed, 12 Aug 2009 22:08:49 +0200, Michael Jung
<> wrote, quoted or indirectly quoted someone
who said :

>
>You know that that one is meaningless in the context the question
>arose in?


For me, reading most posts is like reading a foreign language. I can
pick out a few keywords, and I guess at the general problem area, and
I hand out some standard advice. Posted code is usually so atrocious
it would be like sifting through dog poo to find bugs in it.

I find it difficult to disginguish between somebody explaining
something complicated, and somebody who has no clue. I don't have the
patience for detailed analysis. Others are much better at it. I
usually find out O.P. is not an addled newbie when someone else
responds with advanced information.

The way I see it, whether what I say solves the O.P.'s particular
problem is secondary. I am talking to the broader audience of people
who have similar problems, and people who may later find the thread
with google.

I feel disgust at an O.P. who complains when someone posts information
he already knows or that is not relevant to his particular problem, as
if the whole point of the newsgroup were to serve him alone.

Who does he think he is, the CEO of a company I work for?

If my newsreader had picons, as Galahad of old had, it would be much
easier to keep track of the skill sets of the various participants. As
it is, except for a handful, all turn into a blur.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"You can have quality software, or you can have pointer arithmetic; but you cannot have both at the same time."
~ Bertrand Meyer (born: 1950 age: 59) 1989, creator of design by contract and the Eiffel language.


Roedy Green
  Reply With Quote
Old 08-12-2009, 10:23 PM   #18
Roedy Green
 
Posts: n/a
Default Re: UTF-8 problems with windows
On Tue, 11 Aug 2009 12:25:17 +0200, Michael Jung
<> wrote, quoted or indirectly quoted someone
who said :

>I used to have new PrintWriter(os), but wanted to enforce the encoding
>and PrintWriter doesn't take one.


If you meant by "enforce", "use a uniform encoding for all your
PrintWriters", use a named constant in all your constructors. In a
large project, I often have a Configure class with almost nothing in
it but named constants that people might likely want to change.

Or of course you could extend PrintWriter to force the default. It is
not a final class.

There are really two logical choices, UTF-8 for interplatform
communication or the platform default.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"You can have quality software, or you can have pointer arithmetic; but you cannot have both at the same time."
~ Bertrand Meyer (born: 1950 age: 59) 1989, creator of design by contract and the Eiffel language.


Roedy Green
  Reply With Quote
Old 08-12-2009, 11:32 PM   #19
Wojtek
 
Posts: n/a
Default Re: UTF-8 problems with windows
Roedy Green wrote :
> If my newsreader had picons, as Galahad of old had, it would be much
> easier to keep track of the skill sets of the various participants. As
> it is, except for a handful, all turn into a blur.


I use MesNews. It has rules which can be applied for various criteria.
For instance, my favourite posters are shown in red text in the message
thread subject column.

Not a true picon, but it does work...

--
Wojtek




Wojtek
  Reply With Quote
Old 08-13-2009, 01:16 PM   #20
Tom Anderson
 
Posts: n/a
Default Re: UTF-8 problems with windows
On Wed, 12 Aug 2009, Mike Schilling wrote:

> And I'd add:
> NullPointerExceptions in a language that insists it doesn't have
> pointers.


Where in the JLS does it insist - or even vaguely affirm - that it doesn't
have pointers?

From the index:

pointers
See references

ISTM that the JLS considers the two words to be synonyms.

tom

--
How did i get here?


Tom Anderson
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Reset / Recover Forgotten Windows NT / 2000 / XP / 2003 Administrator Password wskaihd Software 2 11-17-2009 02:01 AM
How to activate Remote Assistance with XP using Windows Live Messenger Oziisr General Help Related Topics 0 02-01-2008 04:45 PM
Computer Security aldrich.chappel.com.use@gmail.com A+ Certification 0 11-27-2007 02:11 AM
MCITP: Enterprise Support Technician MileHighWelch MCITP 1 06-19-2007 10:25 PM
Re: Question about MS critical updates John Coode A+ Certification 0 06-30-2004 06:08 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46