Table of Contents |
---|
Overview
FIX Antenna (Java?) products fully support UTF-8 encoding.
...
The support of non-ASCII characters was introduced in FIX-protocol since FIX 4.2 (??? https://www.fixtrading.org/standards/fix-4-2/).
...
- Special Encoded fields are added for work with Non-ASCII symbols.
- The field MessageEncoding(347) should be specified with the encoding which are is used in the other Encoded* fields of the message.
- The length fields (Encoded*Len) should contain the count of BYTES (Important: not count of symbols) contained in corresponding Encoded* field.
...
The example shows how to work with tags: EncodedText (355) and EncodedTextLen (354) encoded by MessageEncoding (347)
Field name | Field number | Field value |
---|---|---|
MessageEncoding | 347 | Shift_JIS |
EncodedTextLen | 354 | 15 |
EncodedText | 355 | こんにちは |
Message example: encoding testing.txt
Info |
---|
Doesn't work in FIX Client Simulator |
For custom tags,
...
Work with User-defined Encoded Fields
To create a new user-defined field using encoded symbols one should create an extra field for the length of the encoded text in bytes.
Example
Field name | Field number | Field value |
---|---|---|
MessageEncoding | 347 | Shift_JIS |
EncodedUserFieldLen | 50354 | 15 |
EncodedUserField | 50355 | こんにちは |
The counterparty must also expect the encoding in these fields.
Dictionary configuration example:
Code Block | ||||
---|---|---|---|---|
| ||||
<fielddic>
<!-- ... -->
<fielddef tag="50354" name="EncodedUserFieldLen" type="int"/>
<fielddef tag="50355" name="EncodedUserField" type="String"/>
<!-- ... -->
</fielddic>
<msgdic>
<!-- ... -->
<msgdef msgtype="B" name="NEWS">
<!-- ... -->
<field tag="50354" name="EncodedUserFieldLen" condreq="existtags(T$50355)"/>
<field tag="50355" name="EncodedUserField" condreq="existtags(T$50354)"/>
</msgdef>
<!-- ... -->
</msgdic> |
Message example: encoding-testing-custom.txt
FIX Protocol and UTF-16 Encoding
...