I have been doing a SMS related project. SMS from China Unicom Gateway Deliver is UCS2 encoded.
I found some information on the Internet to find some code that uses the API conversion with the Java language itself, but there is no suitable Delphi source code, so I wrote one after the study, very simple:
Function UCS2TOGBK (Const INVALUE: STRING): String; var i: = '; for i: = 1 to Length (Invalue) Div 2 - 1 Do Result: = Result Widechar (STRTOINT (' $ " INTTOHEX (ORD (INVALUE [2 * I - 1]), 2) INTTOHEX (ORD (Invalue [2 * I]), 2)));