• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data File Format - US ASCII

 
Henrik Strand
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

One question regarding Data File Format - US ASCII:

The spec states that the database file encoding is 8 bit US ASCII. I have also seen some posts that use getBytes("US-ASCII"), but according to Java API: US ASCII is "Seven-bit ASCII".

Do I really need to care about this issue? I've tried reading from the file and the printed output looks ok...

Feedback is appreciated!

Regards,
Henrik
 
hatim osman
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

That's a good question, I have beem using ISO-8859-1 all over the place and it works pretty well for me. I am not sure though if the assessor will appreciate this..

Hatim
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henrik,

This is one of those issues that Sun have deliberately added that have no correct answer. They are more interested in how you justify what you have done than in what you actually do.

So you can go with US-ASCII (knowing that it is 7 bit, but you are meeting the US-ASCII requirement), or you could go with one of the supersets of US-ASCII (giving you the 8 bit requirement, but no longer strictly using US-ASCII).

Either options is reasonable. Neither option will result in failure.

Regards, Andrew
 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is also this reply from Sun on this issue in bold below
You can read the full discussion here


I got really tired of this 7 vs 8 bit discussion and sent the following message to Sun:

"I have a question about the specifications for the URLyBird project version 1.2.3. The Data file format states �The character encoding is 8 bit US ASCII�. This is not a standard encoding supported by Java. I have considered using either charset �US-ASCII� which is 7 bit or �ISO-8859-1� which is 8 bit. There has been a lot of discussion on the Javaranch forum about this, but a lot of confusion remains. It has been suggested that this is a typo and should have read �7 bit US ASCII�.

/thank you"

and got the following, very short reply, that should end this discussion.

"Use ISO-8859-1"


Regards,
Ronald Wouters
[ February 07, 2006: Message edited by: Ronald Wouters ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic