This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Reg : Encode in UTF-8 with BOM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reg : Encode in UTF-8 with BOM" Watch "Reg : Encode in UTF-8 with BOM" New topic

Reg : Encode in UTF-8 with BOM

chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 70
Hi All,

I am having following problem

How to convert the file in Encode in UTF-8 with BOM in java process.When I want to open the file in the notepad++ , the format shows the Encode in UTF-8 , but not Encode in UTF-8 without BOM.
I used the following code to convert into UTF- 8 , But its not getting the excact output (Encode in UTF-8 with BOM).

Please can you send the sample code to get the excat UTF-8 with BOM

Thanks in Advance

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41060
We don't know what "chaine" is, but what does the "\r\n" have to do with the BOM? The BOM is contained in the first few bytes of the file:

Ping & DNS - my free Android networking tools app
Rob Spoor

Joined: Oct 27, 2005
Posts: 19649

What is BOM?

Ah, Ulf already provided the answer.

How To Ask Questions How To Answer Questions
Consider Paul's rocket mass heater.
subject: Reg : Encode in UTF-8 with BOM
Similar Threads
Character encoding using Java
Coversion of ResultSet
Encode Data
What is Encoding and character conversion
Null teminating a string