• Welcome to Valhalla Legends Archive.
 

DebugOutput for Double-Byte

Started by Grok, July 08, 2004, 09:21 AM

Previous topic - Next topic

Grok

Just yesterday I realized that my DebugOutput function displays double-byte character sets as single-byte output.  If someone wants something to do, how about updating it to properly show doublebyte output?

TheMinistered

Sure, start with posting the code to method debugoutput in this thread.


Adron

I think double-byte output should be optional. When you receive b.net packets, some of the low ascii might be interpreted as double-byte characters, and outputting those as such would ruin the use of it for displaying binary data / single-byte characters.

Tuberload

Quote from: Adron on July 09, 2004, 03:31 AM
I think double-byte output should be optional. When you receive b.net packets, some of the low ascii might be interpreted as double-byte characters, and outputting those as such would ruin the use of it for displaying binary data / single-byte characters.

I have very little knowledge of VB, but wouldn't you just convert the string to a byte array and handle it that way?
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Adron

Quote from: Tuberload on July 09, 2004, 01:03 PM
Quote from: Adron on July 09, 2004, 03:31 AM
I think double-byte output should be optional. When you receive b.net packets, some of the low ascii might be interpreted as double-byte characters, and outputting those as such would ruin the use of it for displaying binary data / single-byte characters.

I have very little knowledge of VB, but wouldn't you just convert the string to a byte array and handle it that way?

Well, what I mean is that the contents of a packet can be interpreted either as single-byte characters, as is mostly the case with b.net, as multi-byte characters, or as double-byte characters, and this is protocol dependent. The DebugOutput function can't know how to interpret the data you pass it, so there must be a way of telling it.

TheMinistered

Here is a good way to tell it...

Public Enum CharacterType
   Single = 0
   Double = 1
   Multiple = 2
End Enum

Public Function DebugOutPut(... , Optional ByVal CharacterType as CharacterType = Single)