INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Windows display Little Endian text file

Windows display Little Endian text file

(OP)
I would like to output the contents of a Little Endian text file.

I thought this was quite a simple task but it seems to be not that straight forward, from a Unix point of view I would just use the iconv command does Windows have a similar command or a simple way to do this?

RE: Windows display Little Endian text file

(OP)
Should I be looking at the _wfopen?

RE: Windows display Little Endian text file

Try notepad. File/Save As. Down the bottom, there is a combo box for encoding.

RE: Windows display Little Endian text file

(OP)
Thanks for your reply xwb, I was looking to do it within a c++ program as it is to be part of the output to a socket program I have.

RE: Windows display Little Endian text file

Is that file output or socket output?

RE: Windows display Little Endian text file

(OP)
Hi basically the socket program all programs in a directory and the output is from the program is displayed to the socket when a connection is made.

To simplify what I am trying to do if the file wasn't Unicode LE type I could just run the system command, type myfile.txt and that would be ok. Because of the unicode the "type" command doesn't display correctly.

RE: Windows display Little Endian text file

(OP)
He is some example code of how I can do it with the iconv command:-

#include <stdio.h> /* printf */
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */

int main ()
{
int i;
setvbuf(stdout, (char*)NULL, _IONBF, 0);
printf ("MyFile\n");
setvbuf(stdout, (char*)NULL, _IONBF, 0);
if (system(NULL));
else exit (EXIT_FAILURE);
i=system ("iconv -f utf-16le -t utf-8 C:\\myfile.txt");
printf ("\n");
return 0;
}

RE: Windows display Little Endian text file

(OP)
I manged to get one on the c++ guys to take a look and it was not quite as simple as my inital program.

But thanks for trying xwb

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close