question

Upvotes
Accepted
1 0 1 3

We are trying to contribute norwegian characters to pages using RFA.NET version 8.

The string gets converted to some strange ascii codes in the buffer and the result is that we get an error stating the text is too big.

How can we achieve sending norwegian characters through the API. This works fine from Excel.

treprfarfa-apic#.net
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
38.1k 71 35 53

Most fields in RDMFieldDictionary use RMTES (Reuters Multilingual Text Encoding Standard).

DSPLY_NAME "DISPLAY NAME" 3 NULL ALPHANUMERIC 16 RMTES_STRING 16

ROW64_1 "MONROW 1" 215 NULL ALPHANUMERIC 64 RMTES_STRING 64

ROW64_2 "MONROW 2" 216 NULL ALPHANUMERIC 64 RMTES_STRING 64

ROW64_3 "MONROW 3" 217 NULL ALPHANUMERIC 64 RMTES_STRING 64

ROW64_4 "MONROW 4" 218 NULL ALPHANUMERIC 64 RMTES_STRING 64

To encode Norwegian characters (æ, â, å) in RMTES fields, you need to follow this standard.

For example:

To convert RMTES to UTF8 or UCS2, you need to use RMTESConverter class in RFA.NET package. For more information, please refer to Section 5.2.5 RMTESConverter in the RFA.NET Developers Guide.


reuters1-2.png (30.4 KiB)
example.png (4.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

For Norwegian characters, the RMTES encoding is the same as Unicode encoding, which means you can use .NET UnicodeEncoding .

byte[] byte_to_send = UnicodeEncoding.Unicode.GetBytes("Riksmål åæâéèêøóòô");
byte_to_send = byte_to_send.Where(b => b != '\0').ToArray(); // Linq: remove '\0' character from byte array
RFA_String rfaString = new RFA_String(byte_to_send);
dataBuffer.SetFromString( rfaString, ThomsonReuters.RFA.Data.DataBuffer.DataBufferEnum.StringRMTES );
field.Data = dataBuffer;
Click below to post an Idea Post Idea