I’d like to print a SOAP response message to a Web Service caller ,
I did print the <?xml version="1.0" encoding="utf-8" ?> in SOAP response message , but I got a trouble when I print a Traditional Chinese char , the caller will get ??? code .
I cannot transfer the response string to UTF-8 format successfully ,
Use Lotusscript’s Evaluate() function to run @URLEncode(“UTF-8”, “yourTextToBeEncoded”)…
If the text you need to encode is more than 64k, you need to store the text in a in-memory document and reference the document’s item via the Evaluate function instead, as you cannot use more than 64k of literal string text in @formulas.
I tried your way , but get a string that had transfer all special char (like “<” ,“>”) and Traditional Chinese char to some “%xx%yy%zz” code , where “%xx” indicate to a ascii code for the char.
But ,this seems not an acceptable format for a Soap Message , the caller cannot parse the message .
Subject: How to transfer LMBCS string into UTF8 format & Print it ?
If the first line that you print is like:Content-Type: text/xml; charset=utf-8
then Domino uses this to replace its default Content-Type header, and also parses it and converts everything else that you print to the specified charset. Strange but useful.
By the way, a String in LotusScript is Unicode, not LMBCS.
Subject: RE: How to transfer LMBCS string into UTF8 format & Print it ?
Hi, Rod :
Thanks for your advices , it helps so much.
When I Create a notesstream, and set it as a xmldomparser output , the original charset is unicode, but the charset of the notesstream will be changed to x-lmbcs automatically after I execute xmldomparser.serialize, is it normally or I miss any setting ?