• Specialchars after migration from OKM5 to OKM6

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #23696  by Linsche
 
Hello,

I upgraded our OKM version 5 to v6.2.4. After I changed my webservice funktions for the new version, I ran into the problem
that all of the filename with german special characters get convertet in HTML entities. So something must have changed in this new
version of OpenKM. I tried to convert the filenames to UTF-8, HTML entities ... it's always the same outcome.

Überprüfen.xlsx -> Überprüfen.xlsx

If I use the webclient there is also some kind of thing which converts Ü to U.

There were no such issues in OpenKM 5. Am I missing some parameter I have to set or anything like this?

Thank you!

Greets!
 #23710  by jllort
 
I would like to understand better the problem. The problem you got is on ws or when you browser document with UI ?

Ensure in your setenv go something like -Dfile.encoding=utf-8 ( which is a directive to run application in utf-8 codification ).
 #23725  by Linsche
 
First I checked the setenv file but the encoding is set to utf-8. I hope I can gibe further information.

The problem is that the path /okm:root/Test/Überprüfen.xlsx is somehow converted to /okm:root/Test/Überprüfen.xlsx. when creating this file via webservice.
If I use the normal file upload in OKM frontend, the filename is changed like this: Überprüfen.xlsx -> Uberprufen.xlsx

The process is like this: User uploades the file with normal http upload request. A PHP script is doing the webservice part like creating the path from given data and putting
everyhing togehter.
Code: Select all
...
$filesize = filesize($file);
$document = array('path' => $path.utf8_encode($filename),
	  		     'checkedOut' => 0,
	  		     'convertibleToPdf' => 1,
	  	             'convertibleToSwf' => 0,
                             'convertibleToDxf' => 0,
	  	             'keywords' => '',
                             'locked' => 0,
	  		     'permissions' => 15,
	  		     'subscribed' => 0	);
try
{
     $result = $documentsRequest->create(array('token' => $token, 'doc' => $document, 'content' => file_get_contents($file)))->return;
}
Until this point the path is normal like above. In the result the path has changed and I also can see these changes in OpenKM frontend.
Its doesn't seem to happen because of my HTML/PHP or webserver. I Just changed the version of OKM from 5 to 6 and updated some funktions
because of the changes of the webservice functions. all the other tings stayed the same. It worked with OKM5 this way.

Like said, OKM is also changing the filenames when using it's frontend but in an other way.

Thank you!
 #23744  by jllort
 
This is strange 'path' => $path.utf8_encode($filename) because path should be something like okm:root/ etc... , and not local filename path ?

Could you test to set path as string "/okm:root/test/somefile.doc"

Take a look here for two examples, normal creation and create simply http://wiki.openkm.com/index.php/PHP_cl ... OpenKM_6.2 in your case create simply is enought for you.
 #23766  by Linsche
 
Sorry I schould have posted more code.

The /okm:root/test thing ist stored in the variable $path and build from different parameters.
I add the filename encoded in utf-8 to this path.

I will try to use the simple creation and write the outcome hier.

Thank you!

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.