Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Previous Next

FWIW, here's a working solution that uses a NotesStream object.

Below is a Function that uses a NotesStream object to perform the conversion. The trick is to supply "LMBCS" for the charset parameter to NotesStream.Open() when writing to the stream. Note that "LMBCS" is an undocumented keyword not mentioned in Designer Help (as of 8.5.3). Yet I'm quite confident that it will continue to be supported in future versions of Notes, given that LMBCS is the native character set of Notes.

' * Function converts a LotusScript string by interpreting it as if it were UTF-8.
' * @param rText references a LotusScript string to be interpreted as UTF-8.
' * @param rFilePath specifies the complete path to a temporary file to use for the conversion.
' * @return a string that is obtained by decoding the sequence of bytes contained in <code>rText</code> using UTF-8.
' * @error 75 (ErrPathFileAccessError) if writing to <code>rFilePath</code> fails.
' */
Function Convert(rText As String, rFilePath As String) As String
Dim sn As New NotesSession()
Dim ns As NotesStream
If Dir$(rFilePath) <> "" Then Kill rFilePath
Set ns = sn.CreateStream()
Call ns.Open(rFilePath, "LMBCS")
Call ns.WriteText(rText)
Call ns.Close()
Call ns.Open(rFilePath, "UTF-8")
Convert = ns.ReadText()
Call ns.Close()
End Function

Example: This will print "".
Print Convert("├├├", "C:\Temp\MyStream.txt")

Feedback response number JSAK99QBXM created by Jochen Sack on 07/18/2013

How to decode a UTF-8 encoded strin... (Casper Skovgaar... 15.Jul.13)
. . Either use a framework like jQuery ... (Kenneth Axi 15.Jul.13)
. . . . Decode should be on the server (Casper Skovgaar... 15.Jul.13)
. . Getting closer with GetValueCustomD... (Casper Skovgaar... 16.Jul.13)
. . Tentative approach: Use a NotesStre... (Jochen Sack 16.Jul.13)
. . . . Convert to byteArray is not working... (Casper Skovgaar... 16.Jul.13)
. . . . . . Meanwhile I took a deeper look into... (Jochen Sack 17.Jul.13)
. . . . FWIW, here's a working solution tha... (Jochen Sack 18.Jul.13)
. . . . . . LMBCS does the trick (Casper Skovgaar... 12.Aug.13)


Search this forum

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite