ssaharshitha bobba

Greenhorn
+ Follow
since Sep 08, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by ssaharshitha bobba

1)What is Encoding and Character conversion?

2)InputStreamReader, OutputStreamWriter and CharsetDecoder &CharsetEncoder are for the same purpose.or they different functionality?
18 years ago
What is Encoding and Character conversion?

What is US-ASCII to UTF-8 encoding and UTF8

suppose, I want to encode the US-ASCII data into UTF-8.

For that what is the procedure.

I have to use

1.InputStreamReader and OutPutStreamReader
2.Charset/CharsetEncoder/CharsetDecoder . Is is right?

What is the difference between the two processes?

Process 1:

Read ASCII data and store into some string object

FileOutputStream fos = new FileOutputStream(outputFile);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");

Process 2:

Charset charset = Charset.forName(encode);
CharsetDecoder decoder = charset.newDecoder();
CharsetEncoder encoder = charset.newEncoder();

my question is:
is InputStreamReader, OutputStreamWriter and CharsetDecoder &CharsetEncoder are for the same purpose.or they different functionality?
18 years ago
Why they have kept InputStreamReader and Charset for the same purpose or is there any difference?
18 years ago
I want to encode the US-ASCII data into UTF-8.

For that what is the procedure.

I have to use

1.InputStreamReader and OutPutStreamReader
2.Charset/CharsetEncoder/CharsetDecoder

What is the difference between the two processes?

Process 1:

FileInputStream fis = new FileInputStream(inputFile);
InputStreamReader isr = new InputStreamReader(fis,"UTF-8");

FileOutputStream fos = new FileOutputStream(outputFile);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");

Process 2:

Charset charset = Charset.forName(encode);
CharsetDecoder decoder = charset.newDecoder();
CharsetEncoder encoder = charset.newEncoder();
18 years ago