• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is Encoding and character conversion

 
ssaharshitha bobba
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
ssaharshitha bobba
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)What is Encoding and Character conversion?

2)InputStreamReader, OutputStreamWriter and CharsetDecoder &CharsetEncoder are for the same purpose.or they different functionality?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!