thanks for the help Jon. You are right. it looks like the 437 char set is
the one I want. example of the set can be found at
http://www.georgehernandez.com/xComp...erSets/OEM.htm
I double check my label printers on my line i sent the ascii value of
char(130) and i recieved the results that i expected. now then i'm having a
problem with the conversion of the string still maybe you or someone can
point out where i'm going wrong. I'm still getting a code of 233 for char é
when it should be 130
'conversion code for my 437 encoding
' Create two different encodings.
Dim ibm437 As Encoding = Encoding.GetEncoding(437)
Dim [unicode] As Encoding = Encoding.Unicode
' Convert the string into a byte[].
Dim unicodeBytes As Byte() = [unicode].GetBytes(Me.TextBox1.Text)
' Perform the conversion from one encoding to the other.
Dim ibm437Bytes As Byte() = Encoding.Convert([unicode], ibm437,
unicodeBytes)
' Convert the new byte[] into a char[] and then into a string.
Dim imb437Chars(ibm437.GetCharCount(ibm437Bytes, 0,
ibm437Bytes.Length)) As Char
ibm437.GetChars(ibm437Bytes, 0, ibm437Bytes.Length, imb437Chars, 0)
Dim imb437String As New String(imb437Chars)
'checking my results from the conversion in a message box
Dim chrArr() As Char
chrArr = imb437String.ToCharArray
Dim pos As Integer
While pos < chrArr.Length
Dim c As Char
MsgBox(Asc(chrArr(pos)) & " " & chrArr(pos))
pos = pos + 1
End While
"Jon Skeet [C# MVP]" wrote:
john <jo**@discussions.microsoft.com> wrote: The problem i have is that i'm sending this data to a case labeling printer
that requires ascii.
No, it requires more than just ASCII by the sounds of it - as I said
before, actual ASCII only goes up as far as 127.
Now it does use the extended ascii set i know there are
multiples of them but the most common one of them is used. Here is a page
that has the extend chars that i need: http://www.lookuptables.com/
so is there a way to get those extended char values from the input string?
That's far from the most common these days (despite what the web page
says) - it's an encoding from the DOS days. I *suspect* it's code page
437, which you can get with Encoding.GetEncoding(437). It's worth
trying, certainly.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too