Warm tip: This article is reproduced from serverfault.com, please click

How to use quickfix for two symbols in char field

发布于 2021-07-13 13:36:05

I have noticed that in Fix version 4.4 they use two symbols for a char field

Example below:

FIX 4.4 : MiscFeeType <139> field
Type: char

So lets see what values are defined for these field

https://www.onixs.biz/fix-dictionary/4.4/tagnum_139.html

10 = Per transaction
11 = Conversion
12 = Agent

But char is by definition only one character

https://www.onixs.biz/fix-dictionary/4.4/index.html#char

So when I feed fix44.xml dictionary file and generate C# code I end up with errors like

error CS1012: Too many characters in character literal

public const Char PER_TRANSACTION = '10';
Questioner
Captain Comic
Viewed
0
Grant Birchmeier 2021-07-14 23:49:45

Easy: Change 139's type to String in your DD.

In QuickFIX/n, 139 has been generated as a StringField since 2011. See source.