Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Convert a file in UTF8 format to UTF16 on command-line

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Thanked 0 Times in 0 Posts

    Default Convert a file in UTF8 format to UTF16 on command-line

    I have a tool that outputs a UTF8 file. This file is to serve as an output to another utility that functions with a UTF16 input.
    Is it possible to write a small script that will convert the UTF8 to UTF16 so that I can put it in a batch file.
    Am a newbie to Java and maybe this question has already been handled. I have searched quite a bit but have not found anything of that type.
    Any help most gratefully ackowledged

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    On vacation
    Thanked 2,425 Times in 2,378 Posts

    Default Re: Convert a file in UTF8 format to UTF16 on command-line

    Look at the InputStreamReader and OutputStreamWriter classes. Their constructors take parameters for different charactersets.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. How to convert GSM 6.10 wav file to MP3/PCM/OGG/AU format using JAVA?
    By expertise in forum Java ME (Mobile Edition)
    Replies: 4
    Last Post: April 11th, 2014, 02:13 AM
  2. File Processing- Command Line Arguments
    By TSSF44 in forum What's Wrong With My Code?
    Replies: 17
    Last Post: November 21st, 2013, 07:52 PM
  3. How to convert date to different format
    By sebE23 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 30th, 2013, 03:44 AM
  4. Replies: 10
    Last Post: September 16th, 2011, 07:49 PM
  5. [SOLVED] Giving Java the name of a file to be read via command line?
    By lavloki in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: October 14th, 2010, 10:07 AM