Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Convert Unicode Little Big Endian Format File
I want to create file i can use on PowerPC but the only options to write this file are Ansi and Unicode. And this Unicode writing generates an Unicode Little Endian format.
Help.
input = 'c:\temp\Unicode.txt' size = FileSize(input) ;Allocate two seperate binary buffers buffer1 = BinaryAlloc(size) buffer2 = BinaryAlloc(size) ;Initialize buffer with data BinaryRead( buffer1, input ) ;Loop through file two bytes at a time For x = 0 To size-2 By 2 ;Read out 2 hex bytes at a time bytes1 = BinaryPeekHex(buffer1, x, 1) bytes2 = BinaryPeekHex(buffer1, x+1, 1 ) ;Write out swapped hex bytes BinaryPokeHex(buffer2, x, bytes2) BinaryPokeHex(buffer2, x+1, bytes1) Next BinaryWrite( buffer2, 'C:\temp\BigEndian.txt' ) ;Free Binary Buffers BinaryFree(buffer1) BinaryFree(buffer2)
Article ID: W17916
Filename: Convert Unicode to Big Endian Format File.txt
File Created: 2008:04:24:11:33:14
Last Updated: 2008:04:24:11:33:14