Hello Everyone,
can anybody tell me how to encode/decode this data mention below
Input file sample.s37
S00F000053424C5F352E30352E3000008A
S315FFFFB800541A63FF090063E7050063EF0100400772
S315FFFFB81025B640070CB6400704B60162406790B6EF
output file sample.kbf
Tc c c @%@@b@g@ @@g ^`_ ^ F? f 6aH? `7`g? V.7
i've already applied some UTF-8/16/32/EBCD/ASCII, UCS Technique -
use Encode;
-
use strict;
-
{
-
open (INPUT, "sample.s37");
-
open (OUTPUT, ">sample.kbf");
-
binmode(INPUT);
-
binmode(OUTPUT);
-
my ($n, $data, $buf);
-
while ($data=<INPUT>)
-
{
-
read (INPUT, $data, 2 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 8 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 2 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 32 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT ": $data ";
-
read (INPUT, $data, 2 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data \n";
-
}
-
close(INPUT);
-
close(OUTPUT);
-
}
-
-
open (OUTPUT, "sample.kbf");
-
binmode(OUTPUT);
-
while ($data=<OUTPUT>)
-
{
-
read (INPUT, $data, 2 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 8 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 2 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 32 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT ": $data ";
-
read (INPUT, $data, 2 );
-
$data = decode('UTF-16', $data);
-
print "$data\n";
-
}
-
close(OUTPUT);
-
}
-
-
Thanks & Regard.
Lokiiii
2 1571
Hello Everyone,
can anybody tell me how to encode/decode this data mention below
Input file sample.s37
S00F000053424C5F352E30352E3000008A
S315FFFFB800541A63FF090063E7050063EF0100400772
S315FFFFB81025B640070CB6400704B60162406790B6EF
output file sample.kbf
Tc c c @%@@b@g@ @@g ^`_ ^ F? f 6aH? `7`g? V.7
i've already applied some UTF-8/16/32/EBCD/ASCII, UCS Technique -
use Encode;
-
use strict;
-
{
-
open (INPUT, "sample.s37");
-
open (OUTPUT, ">sample.kbf");
-
binmode(INPUT);
-
binmode(OUTPUT);
-
my ($n, $data, $buf);
-
while ($data=<INPUT>)
-
{
-
read (INPUT, $data, 2 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 8 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 2 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 32 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT ": $data ";
-
read (INPUT, $data, 2 );
-
$data = encode('UTF-16', $data);
-
print OUTPUT "$data \n";
-
}
-
close(INPUT);
-
close(OUTPUT);
-
}
-
-
open (OUTPUT, "sample.kbf");
-
binmode(OUTPUT);
-
while ($data=<OUTPUT>)
-
{
-
read (INPUT, $data, 2 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 8 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 2 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT "$data ";
-
read (INPUT, $data, 32 );
-
$data = decode('UTF-16', $data);
-
print OUTPUT ": $data ";
-
read (INPUT, $data, 2 );
-
$data = decode('UTF-16', $data);
-
print "$data\n";
-
}
-
close(OUTPUT);
-
}
-
-
Thanks & Regard.
Lokiiii
Lokiiii,
Changing the subject of your posting, but including the same information, does not mean you are going to get a different answer.
As I mentioned in your last thread, you are going to have to examine the code of the other program you mentioned and find out exactly what it is doing to the data in order to duplicate it. Without that knowledge nobody will probably be able to assist you.
Regards,
Jeff
Lokiiii,
Changing the subject of your posting, but including the same information, does not mean you are going to get a different answer.
As I mentioned in your last thread, you are going to have to examine the code of the other program you mentioned and find out exactly what it is doing to the data in order to duplicate it. Without that knowledge nobody will probably be able to assist you.
Regards,
Jeff
hello jeff,
hey this is not same quetion. before that i had asked about binary file. and i'd asked not making binary file because data coming same but here i made it binary file and data is not coming in binary by encoding technique but data not decoding... and earlier you don't about this and not now. if you know encoding/decoding so please give me answer except giving...perl.org encode
thanks & regards
Lokiiii
Sign in to post your reply or Sign up for a free account.
Similar topics
by: steve |
last post by:
Hi,
I am opening a stream that is UTF encoded. I use fgetc to read the
stream- which is binary safe. I add every character read to a string.
But when I look at the stream, I see some...
|
by: Thomas Williams |
last post by:
Hello everyone, my name is Tom W. And, I am new to the
list, and have been using Python for about a year now.
Anyway, I got a question! I am trying to decode MIME
(base64) email from a POP3...
|
by: Mark Rodrigues |
last post by:
Hi everyone,
Today we hit a problem when we rolled a new web-site are were
presented with a error on our page that looked like:
Security Exception
Description: The application attempted to...
|
by: Peter Row |
last post by:
Hi all,
Here is my problem:
I have a SQL Server 2000 DB with various NVarChar, NText fields in its
tables.
For some stupid reason the data was inserted into these fields in UTF8
encoding.
...
|
by: Johann Blake |
last post by:
In my need to decode a JPEG 2000 file, I discovered like many that
there was no functionality for this in the .NET Framework. Instead of
forking out a pile of cash to do this, I came up with the...
|
by: Slade |
last post by:
Hi,
I'm trying to use POST an image to a web page with WebRequest/WebResponse.
Only problem is that I must be making an error somewhere in the
encoding/decoding process. I've pasted below a bit...
|
by: Peter Jansson |
last post by:
Hello group,
The following code is an attempt to perform URL-decoding of URL-encoded
string. Note that std::istringstream is used within the switch, within
the loop. Three main issues have been...
|
by: marcin.rzeznicki |
last post by:
Hello everyone
I've got a little problem with choosing the best decoding strategy for
some nasty problem. I have to deal with very large files wich contain
text encoded with various encodings....
|
by: pmz |
last post by:
Dear Group,
I've got a problem with decoding e-mail message subject, which has
been read within usage of Pear_Mail_Mime library.
There are some elements unwelcome in my subject string, such...
|
by: Michele |
last post by:
Hi there,
I'm using a python script in conjunction with a JPype, to run java classes.
So, here's the code:
from jpype import *
import os
import random
import math
import sys
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |