Friday, October 30, 2009

FTP Issue: LPX-00200: could not convert from encoding UTF-8 to UCS2

I have an application that uploads XML files into an Oracle XML DB Repository. It was workinging succesfully on all documents except a few would fail...

My application would report the error:

FTPConnection closed

And in my Oracle logs I could see this error:

LPX-00200: could not convert from encoding UTF-8 to UCS2

I looked at the failing XML documents and noticed that they all had curly quotes in them. If I took them out, the file would upload.

The issue was that I needed to FTP as Binary and not as Text.

I was using the Java libarary FTPClient (it.sauronsoftware.ftp4j.FTPClient) and needed to set this command:


FTPClient .setType(FTPClient.TYPE_BINARY);

So just remember to use Binary mode when uploading to an Oracle XML DB Repository.

Thursday, October 1, 2009

Get the version number of an IDfSysObject in Documentum using DFC

I was in a situation where I needed to get the version number of a document. Such as 1.0 or 2.6 etc...

Unfortunately Documentum only provides a repeating attribute called r_version_label. This attribute can contain other values such as CURRENT or other user entered values.

But the important thing to note is that Documentum always stores the version number in the first r_version_label value.

Based on this assumption you can retrieve the version number from an IDfSysObject using the following ...

IDfSysObject.getRepeatingString("r_version_label", 0);


Hope this is helpful.