views:

138

answers:

2

Does anybody know what ^Bo means at the beginning of a encoded string? The rest of the string is valid ASCII.

Example: "^BoHello" should be interpreted as "Hello"
Note: '^B' is the control character 0x02

+5  A: 

Ascii 0x02 is 'start of text' - never seen it used though, probably a hangover from some legacy system

Martin Beckett
@Martin: I see it all the time in financial systems.
John Dibling
@John Dibling - I assume fnieto is getting the data from some legacy system. Of course legacy in banking is defined as - stuff that works ;-)
Martin Beckett
@John Dibling: What language?
Martin York
@Martin: I should have been less terse. Many of the world's exchanges use SOH and ETX in their binary protocols. Relatively few use self-describing formats like XML (or the financial equivalent, FIX) because they are too fat, and so most use proprietary binary protocols. Many of these are variable length to accommodate things like ticker symbol in as few bytes as possible and pack multiple messages in a single UDP frame. Some exchanges use byte counters, others use SOH/ETX, and some even use both.
John Dibling
@Martin: But to answer your actual question, C++.
John Dibling
@John Dibling: So it is an artifact of the protocol used not because of somthing in the language (which makes sense).
Martin York
I found that in a TibcoRv encoded string. I know that 0x02 is STX, but the thing is what that pair represents?A TibcoRv string is codified as <field_name><type><length><value> and it is in the value where I got those 2 bytes appended at the beginning of the string. In the rest of the strings they don't appear.
fnieto
@Martin: Exactly. @fnieto: I have very little experience with Tibco. But is it really 'hello'?
John Dibling
@John Dibling - Yes it's a pity that PCs don't use more of the ASCII control chars. It would be much easier if CSV files used record separator rather than having to deal with quoting commas, or european CSV files using semi-colons.
Martin Beckett
+2  A: 

Ascii Control Characters.

Duck