Ticket Created
over 3 years ago

CIQQA-1299

Strings in FIT file are cut in half for non-ASCII unicode characters

When I set my field to 8 characters, I can indeed enter and save 8 ASCII characters:

<setting propertyKey="@Properties.n" title="@Strings.settingsSaveAlias">
    <settingConfig type="alphaNumeric" maxLength="8"/>
</setting>
(BTW it's not clear from the documentation, whether the count is in characters or bytes..., but turns out (and it is logical) that maxLength is counted in unicode characters)
When I enter "ABCDEFGH" then I'll see this saved and displayed on the DF's screen.
When I enter "אבגדהוזח" then I also see the 8 Hebrew characters on the screen.
But when I save the same string to a string field in the fit file then the Hebrew string is always cut in half:
mAntNameField = dataField.createField("n", 8, Fit.DATA_TYPE_STRING, { :count=>17, :mesgType=>Fit.MESG_TYPE_SESSION });
(BTW it's not clear from the documentation, whether the count is in characters or bytes...)
I set :count to 17 (that should be plenty enough, because the unicode representation of Hebrew characters are 16 bit, so it should be enough for 8 characters + null)
Then in the fit file (at least in what I see in GCM and GCW) from the ASCII string all the 8 characters are displayed, but from the Hebrew string only 4 characters out of the 8:
entered: "אבגדהוזח" but only got back: "אבגד"
At 1st I thought that this might happen because it uses some different encoding, so maybe each Hebrew character takes 4 bytes, but then I tested that too:
I entered "אבגד" but then I only got back "אב". (BTW When I enter "אבג" then I only get back "אב")
Parents
  • Oh, well, so I tried a workaround: I want to see a 3 Hebrew letter name, so I entered "<space><space><space><letter1><letter2><letter3>", and it's trimming the leading spaces, so I still only get back "<letter1><letter2>". When I add the 3 spaces at the end then it "works".

Comment
  • Oh, well, so I tried a workaround: I want to see a 3 Hebrew letter name, so I entered "<space><space><space><letter1><letter2><letter3>", and it's trimming the leading spaces, so I still only get back "<letter1><letter2>". When I add the 3 spaces at the end then it "works".

Children
No Data