IKovalchuk

Russian symbols wrong in PIPoint value with 'string' type.

Discussion created by IKovalchuk on Nov 6, 2014
Latest reply on Nov 20, 2014 by rgilbert

I have byte buffer which represents utf-8 string.

 

Before write it to PI tag, I convert it to utf-16:

 

 

 
message = Encoding.Unicode.GetString( Encoding.Convert( Encoding.UTF8, Encoding.Unicode, buffer, 0, bytesReaded ) );

 then:

 

 

 
AFValue value = new AFValue(message, afTime);
tag.UpdateValue(value, opt);

 and instead russian characters I get this result:

 

 

http://imgnow.com/uploads/714110611nmnmnm.pngThen I add value from PI SMT i have correct result.

 

AFSDK/Server version: 2.6.0.5843

 

PIServer version: 3.4.390.18

 

System codepage for non unicode applications both cp1251 for afsdk and piserver.

 

Any help? Thx.

Outcomes