|
-
Aug 22nd, 2005, 02:20 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] EBCDIC Question
Hi! mate !
I've to convert some numeric value to EBCDIC format.
Does someone can help me put light on this?
As far as I know, I thing that I have to change the last number for a special one with a “}“ but there stop my knowledge on this.
Thanks in advance!!
Zak
-
Aug 22nd, 2005, 02:42 PM
#2
Fanatic Member
Re: EBCDIC Question
Not sure if this is of any help but I found this piece of code on the web (sorry I forgot the link) that enables you to read an EBCDIC file. I guess the reverse will hold tru if you want to write an EBDIC file since one of the StreamWriters allow you to specify the Encoding.
VB Code:
Dim source As Encoding = Encoding.GetEncoding(37)'///EBCDIC encoding.
Dim path As Encoding = Encoding.ASCII
Dim b As Byte() = path.GetBytes(TextBox1.Text.ToCharArray)
Dim aB As Byte() = Encoding.Convert(source, path, b)
Console.WriteLine(path.GetString(aB))
By the way can someone point us to somewhere we can get a list of encoding numbers for example I would have never guessed that 37 stands for EBCDIC.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Aug 22nd, 2005, 02:43 PM
#3
New Member
Re: EBCDIC Question
I did a Google search on "ASCII to EBCDIC" and got lots of info.
-
Aug 22nd, 2005, 03:04 PM
#4
Thread Starter
Frenzied Member
Re: EBCDIC Question
 Originally Posted by BankCop
I did a Google search on "ASCII to EBCDIC" and got lots of info.
I've also do it .. Don’t worry
I've found a bunch of info about EBCDIC to ASCII but very little for ASCII to EBCDIC.
And what I want is not really to convert string to EBCDIC but the way to write number in EBCDIC format especially the signed number. As far as I know, it Consist of replacing the last number with is signed EBCDIC "equivalent", and it is this "equivalent" that I search for ...
-
Aug 22nd, 2005, 03:13 PM
#5
Thread Starter
Frenzied Member
Re: EBCDIC Question
Ok i've found!!
Code:
-0 -> }
-1 -> J
-2 -> K
-3 -> L
-4 -> M
-5 -> N
-6 -> O
-7 -> P
-8 -> Q
-9 -> R
So for example
-12345.67 will be 12345.6P
-12345.62 will be 12345.6K
-
Aug 22nd, 2005, 03:15 PM
#6
Thread Starter
Frenzied Member
Re: EBCDIC Question
 Originally Posted by Mr.No
Not sure if this is of any help but I found this piece of code on the web (sorry I forgot the link) that enables you to read an EBCDIC file. I guess the reverse will hold tru if you want to write an EBDIC file since one of the StreamWriters allow you to specify the Encoding.
VB Code:
Dim source As Encoding = Encoding.GetEncoding(37)'///EBCDIC encoding.
Dim path As Encoding = Encoding.ASCII
Dim b As Byte() = path.GetBytes(TextBox1.Text.ToCharArray)
Dim aB As Byte() = Encoding.Convert(source, path, b)
Console.WriteLine(path.GetString(aB))
By the way can someone point us to somewhere we can get a list of encoding numbers for example I would have never guessed that 37 stands for EBCDIC.
Thanks for this, the Encoding Namepace is now in my knowledge
-
Aug 23rd, 2005, 02:42 PM
#7
Fanatic Member
Re: [RESOLVED] EBCDIC Question
Zakary
Would you mind posting the link wherw you found the equivalents of -1 -> J, -2 -> K etc.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Aug 23rd, 2005, 03:12 PM
#8
Thread Starter
Frenzied Member
Re: [RESOLVED] EBCDIC Question
 Originally Posted by Mr.No
Zakary
Would you mind posting the link wherw you found the equivalents of -1 -> J, -2 -> K etc.
Hi Mr No!
I've found it here
http://www.discinterchange.com/TechT...d_fields_.html
-
Aug 24th, 2005, 01:12 PM
#9
Fanatic Member
Re: [RESOLVED] EBCDIC Question
Thanks Zakary.
Very interesting site indeed, it reminded me of my COBOL days some 8 years ago
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Aug 24th, 2005, 01:22 PM
#10
Thread Starter
Frenzied Member
Re: [RESOLVED] EBCDIC Question
8 Year ago, I was a doing DbaseIII and Clipper in my case
(Sigh) good old time... when beer and spending money was in the top of my priority hehehe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|