While working with DXL123 freeware Domino app(beta released soon), I found a strange behavior of DXL importer in LotusScript: swedish letters (åäö) in imported stream are changed to garbled characters. But simple stream.ReadText before importing the stream fixes the problem.
I guess it has to do with wrong encoding, maybe with utf-16 being used instead of utf-8, but I don't see how I would change that or why it begins working after stream.ReadText <?xml version="1.0" encoding="utf-16"?>
Dim tmpstream As NotesStream
Dim importer As NotesDXLImporter
Dim fixencoding As String
Set tmpstream = session.CreateStream
Call domParser.setOutput(tmpstream)
Call domParser.Serialize
fixencoding=tmpstream.ReadText 'This makes the result OK
Set importer = session.CreateDXLImporter(tmpstream, sourcedoc.ParentDatabase)
importer.ReplaceDBProperties = False
importer.ReplicaRequiredForReplaceOrUpdate = False
importer.DocumentImportOption = DXLIMPORTOPTION_REPLACE_ELSE_IGNORE
Call importer.Process '.Import gives same result
DXL123 is a set of LotusScript API to easily perform different operations on inline images and on attachments without knowing anything about DXL.
Function available in DXL123:
Copy attachments between documents (without detaching to disk)
Convert inline image to attachment (without detaching to disk)
Change name of an attachment (without detaching to disk)
Remove inline images
Import disk file as an inline image
Place inline image in text after specified word/phrase
Place inline image inside a table
Replace inline picture to another picture
Replace attachment in richtext to URL link
Replace inline image to HTML image reference
Example:
attachment_name=CopyInlineImageToDocAttachment(sourcedoc, targetdoc, "Body", 2, False, True)' make the second image in Body field to become an attachment and delete the original image
Tag: dxl
Showing posts with label DXL. Show all posts
Showing posts with label DXL. Show all posts
Monday, December 01, 2008
Subscribe to:
Posts (Atom)
