|Don't ask to ask, just ask|
convert 7 bit even parity to 7 bit asciiby bear0053 (Hermit)
|on Mar 09, 2004 at 17:12 UTC||Need Help??|
bear0053 has asked for the
wisdom of the Perl Monks concerning the following question:
fellow monks i have come across a situation that baffeled me. I posted this question a little while ago and only got a few responses. hopefully this post will help me determine a solution
i have an encryption object running from win32 that returns binary data in 7 bit Ascii (verified in .NET). When perl gets the property from the object and puts the value into a scalar it converts it to binary 7 bit ascii "even" parity. when .NET applications read this data from the encryption object it is simply read in as 7 bit ascii. why is this happening and what can i do to force it in as 7 bit ascii?
in .NET C# object returns an EOT Hex 04 in 7 bit ascii
in perl the object returns EOT Hex 84 in 7 bit ascii even parity
can it be forced to 7 bit ascii or can i convert the 7 bit ascii even parity to 7 bit ascii easily?
the convert route is not optimal for performance, the cpu is already hit from the auto conversion to 7 bit ascii even parity.
i am using a Win32::OLE object that works like this:
when the code is stored it is stored a 7 bit ascii even parity. so some how perl takes 7 bit ascii and turns it into 7 bit ascii even parity when it writes it to the database. why and how can i stop this? This would be fine if my .net application would read the data from the sql table in as 7 bit ascii even parity and not convert it. But it doesn't. Instead c#.net reads the value from the db as 7 bit ascii even parity and then when it is turned into a byte gets converted to 8bit and then cannot be decrypted.
Thanks in advance
This was previously asked here by me in a slightly different way: NODE 333378
I managed to solve this problem on the .net side using c# code for converting between formats. It wasn't what i was looking for but it bypasses the perl problem.