Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmis:name encoding character error #77

Open
wallon-ines opened this issue Aug 26, 2020 · 3 comments
Open

cmis:name encoding character error #77

wallon-ines opened this issue Aug 26, 2020 · 3 comments

Comments

@wallon-ines
Copy link

I have a problem with charset when upload a document.

eg: if my document name is RéàDME.md in Alfresco I see Réàdme.md

Capture d’écran_2020-08-26_17-51-47

ps: I rework CreateDocument.php for this test

    $cid = $session->createObjectId($document->getId());
    echo "Document has been created. Document Id: " . $document->getId() . " Name:" . $session->getObject($cid)->getName() ."\n";
@wallon-ines
Copy link
Author

If I add _charset_=UTF-8 in form post in my curl request, it's work

How to integrate _charset_=UTF-8 in this library ?

eg:

curl -X POST    http://locfalhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Shared    -u 'admin:admin'    -H 'content-type: multipart/form-data; charset=utf-8; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'    -F cmisaction=createDocument    -F 'propertyId[0]=cmis:objectTypeId'    -F 'propertyValue[0]=cmis:document'    -F 'propertyId[1]=cmis:name'    -F 'propertyValue[1]=jàvà_error_in_STUDIO_3456.log'    -F file=@jàvà_error_in_STUDIO_3456.log -F _charset_=UTF-8 | jq

@sascha-egerer
Copy link
Contributor

@wallon-ines You should be able to define that in the guzzle connection / httpInvoker.

https://github.com/dkd/php-cmis-client/blob/master/examples/CreateDocument.php#L9-L24

@lraghib
Copy link

lraghib commented Jun 3, 2021

@sascha-egerer even if we set the charset like that:

 $httpInvoker = new Client(
            [
                'debug' => true,
                'verify' => false,
                'auth'   => [
                    "xxxx",
                    "xxxx",
                ],
                'headers' => [
                    'charset' => 'utf-8'
                ]
                
            ]
        );

it doesn't work because this line AbstractBrowserBindingService.php#L444 changes the header values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants