Skip to content

Commit 475e6fc

Browse files
authored
Merge pull request #69 from donmendelson/issue40
Clarification on constant char encodings #40
2 parents c687555 + 5629d85 commit 475e6fc

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The [SBE Conformance project](https://github.com/FIXTradingCommunity/fix-sbe-con
4545
The XML namespace for SBE version 1.0 message schemas is [http://fixprotocol.io/2016/sbe](http://fixprotocol.io/2016/sbe).
4646

4747
## License
48-
FIX Simple Binary Encoding specifications are © Copyright 2014-2017 FIX Protocol Ltd.
48+
FIX Simple Binary Encoding specifications are © Copyright 2014-2018 FIX Protocol Ltd.
4949

5050
<a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">FIX Simple Binary Encoding</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.fixtradingcommunity.org/" property="cc:attributionName" rel="cc:attributionURL">FIX Protocol Ltd.</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/FIXTradingCommunity/fix-simple-binary-encoding" rel="dct:source">https://github.com/FIXTradingCommunity/fix-simple-binary-encoding</a>
5151

v2-0-RC1/doc/01Introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ intended to represent all FIX semantics.
99
This encoding specification describes the wire protocol for messages.
1010
Thus, it provides a standard for interoperability between communicating
1111
parties. Users are free to implement the standard in a way that best
12-
suits their needs.
12+
suits their needs. Implementers may use the most appropriate techniques and idioms of programming languages to access data off the wire and manipulate it in applications.
1313

1414
The encoding standard is complimentary to other FIX standards for
1515
session protocol and application level behavior.

v2-0-RC1/doc/02FieldEncoding.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,16 +513,23 @@ control character (code 0).
513513

514514
#### Encoding of char type
515515

516-
This is the standard encoding for char type.
516+
This is the standard encoding for char type. Note that the length attribute defaults to 1, producing a single character rather than a character array.
517517

518518
```xml
519519
<type name="charType" primitiveType="char"/>
520520
```
521521

522+
A field may be specified with a constant character value.
523+
```xml
524+
<field type="charType" name="OptAttribute" id="206" presence=constant>P</field>
525+
```
526+
522527
Wire format of char encoding of "A" (ASCII value 65, hexadecimal 41)
523528

524529
`41`
525530

531+
532+
526533
### Fixed-length character array
527534

528535
Character arrays are allocated a fixed space in a message, supporting
@@ -532,7 +539,7 @@ attribute or a constant attribute.
532539

533540
| FIX data type | Description | Backing primitives | Length (octets) | Required schema attribute |
534541
|---------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------|--------------------------------------------------------------------|
535-
| String | character array | Array of char of specified length, delimited by NUL character if a string is shorter than the length specified for a field. | Specified by length attribute | length (except may be inferred from a constant value, if present). |
542+
| String | character array | Array of char of specified length, delimited by NUL character if a string is shorter than the length specified for a field. | Specified by length attribute | length |
536543

537544
A length attribute set to zero indicates variable length. See [Variable-length string](#variable-length-string-encoding).
538545

@@ -564,7 +571,7 @@ M S F T
564571

565572
`4d5346540000`
566573

567-
A character array constant specification
574+
A character array constant specification. As for a non-constant value, if the constant is shorter than the specified length, it should be padded with NUL characters to fill the fixed-length array.
568575

569576
```xml
570577
<type name="MarketID" primitiveType="char" length="4" description="MIC code"/>

0 commit comments

Comments
 (0)