2 Replies Latest reply on Dec 12, 2013 10:00 AM by cfaure

    UTF8 (chinese characters)




      I have a problem with Chinese character (UTF-8).


      My need is to add values (English and Chinese UTF8  strings) to a string point. The strings to add come from a csv file.


      I just read the values from the csv file (getline C++ command) and sent them to the PI server with no modification (pData->UpdateValue(value.c_str(), timestamp.c_str(), dmInsertDuplicates, NULL); ).


      The values are added but when I want to see them in the process book, the Chinese characters are not correct (in the file : "报警出现" , in the processbook : "鎶ヨ鍑虹幇").


      If I try with this code line "pData->UpdateValue("报警出现", timestamp.c_str(), dmInsertDuplicates, NULL);", the result is ok.


      An idea ?




      Thank you for your help




      Cyril Faure

        • Re: UTF8 (chinese characters)

          Hi Cyril,


          The PSSS service uses PI SDK to communicate with the PI Server. PI SDK is implemented according to the Microsoft COM standard that represents strings as Unicode characters using UTF16 encoding.  Moreover, based on COM Tech, like C++, cannot convert UTF8 to UTF16 automatically.  This might needs your own way to complete the converting.  After this, you could use the UTF16 string as the parameter for the UpdateValue method.


          Xi Wang


          vCampus team