PreferUTF8 property (NotesHTTPRequest - LotusScript)

This property is automatically set based on the values of two other properties: Preferstrings and Preferjsonnavigator. If either of these two properties is set to True, the HTTP request will prefer UTF8 and return the output characters as a UTF-8 byte array.

Defined in

NotesHTTPrequest

Note: You should not set the PreferUTF8 property in your code manually, as it is dependent on the other two properties. Manually setting may lead to confusion and make the code harder to understand.
Note: LotusScript has a limitation on array size. If the UTF-8 byte array of the output exceeds 64 KB, you will encounter an error: "Result string is too long."

Example

Dim session As New NotesSession
Dim httpreq As NotesHTTPRequest
Dim jsonNav As NotesJSONNavigator
Dim baRet As Variant
Dim url As String

url = "yourURL"
Rem if we do not set httpreq.Preferstrings = True or httpreq.Preferjsonnavigator = True, so default Preferutf8
Set httpreq = session.CreateHTTPRequest()
baRet = httpreq.Get(url)
Rem byteArrayRet now is UTF8 byte array. We can create a Json navigator object from that array
Set jsonNav = session.CreateJSONNavigator(baRet)