Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keyword: Convert Unicode Big Endian BinaryPeekHex BinaryPokeHex
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: W17917
Filename: Convert Unicode to Big Endian.txt
File Created: 2008:11:25:11:59:00
Last Updated: 2008:11:25:11:59:00