Question

I have a folder called Test with the following folder:

  • EY 1 P-¦+¡lohy k da+òov+¢m p-¦izn+ín+¡m 2002 - 2004

Then I have the following code

public static void main( String[] args )
{
    File f = new File( "C:\\Test" );
    File [] children = f.listFiles();

    System.out.println( children[0].getName() );
    System.out.println( System.getProperty("file.encoding") );


    lapi.createObjectEx( 0, 3489025, LAPI_DOCUMENTS.OBJECTTYPE, LAPI_DOCUMENTS.FOLDERSUBTYPE , children[0].getName(), ci, oi );

}

I executed the code twice. Once using the Netbeans debugger and another using the jar file from the Windows command line.

Netbeans debug output

> EY 1 P-¦+¡lohy k da+òov+¢m p-¦izn+ín+¡m 2002 - 2004
> UTF-8

Windows Command Line output

> EY 1 P-ª+ílohy k da+‗ov+óm p-ªizn+Ýn+ím 2002 - 2004
> Cp1252

The lapi object stands for Livelink API and is used to create a folder in a Livelink Server ( now called Content Server ) which is a product from OpenText.

When executing from Netbeans the folder is created with the appropriate name in the Livelink Server. When executed from the Windows command line the folder name contains lots of question marks. The encoding issues mean that the folder's name does not display properly in the resulting webpage.

Does anyone have any ideas how I might be able to fix this and set the encoding explicitly when passing the string to my lapi function?

No correct solution

OTHER TIPS

Use this VM (Command Line) argument:

-Dfile.encoding=UTF-8
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top