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 512.0 KiB each and 1.0 MiB total.

@christer.jahren

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,
AHS

@christer.jahren

Please be informed that a reply has been marked as answering the question. Thanks, AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

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 512.0 KiB each and 1.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;

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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