Uploaded image for project: 'Nuxeo .NET Client'
  1. Nuxeo .NET Client
  2. NETCLIENT-8

wrong filename encoding when importing a file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-beta-13281
    • Fix Version/s: 1.0.0-beta-27220
    • Component/s: Automation API
    • Tags:
    • Backlog priority:
      450
    • Sprint:
      nxGang Sprint 9.10.1, nxGang Sprint 10.1.3
    • Story Points:
      3

      Description

      1. install Nuxeo 8.10
      2. install .NET client:
        dotnet restore
          Restoring packages for /my/path/to/myprojet/myprojet.csproj...
          Installing System.Private.DataContractSerialization 4.1.1.
          Installing System.Runtime.Serialization.Xml 4.1.1.
          Installing System.Xml.XmlSerializer 4.0.11.
          Installing System.ComponentModel.EventBasedAsync 4.0.11.
          Installing WinInsider.System.Net.Http.Formatting 1.0.1.
          Installing NuxeoClient 1.0.0-beta-13281.
          Restore completed in 4,13 sec for /my/path/to/myprojet/myprojet.csproj.
        
      3. import attached 行动计划 27 Oct 2017.pdf file through drag and drop
      4. observe the Japanese encoding the filename is correctly encoded (see okScenario.png)
      5. now delete the document and purge the trash
      6. try again to import the file using the following piece .NET code (Nuxeo .NET client):
        using System;
        using NuxeoClient;
        using NuxeoClient.Wrappers;
        
        namespace NXP_thing
        {
          class Program
          {
        
            private static async System.Threading.Tasks.Task makeRequest()
            {
              Client client = new Client("http://localhost:8080/nuxeo/",
                              new Authorization("Administrator",
                                                "Administrator"));
              Document folder = client.DocumentFromPath("/default-domain/workspaces/testWorkspaceNXPTesting");
              Uploader uploader = client.Uploader()
                                  .SetChunked(true)
                                  .SetChunkSize(1024);
              await uploader.AddFile("/my/path/to/行动计划 27 Oct 2017.pdf")
                            .UploadFiles();
              Documents documents = (Documents)await uploader.Operation("FileManager.Import")
                                         .SetContext("currentDocument", folder.Path)
                                         .Execute();
              Console.WriteLine("inside the task");
            }
        
            static void Main(string[] args)
            {
              Console.WriteLine("Hello World!");
              System.Threading.Tasks.Task taskA = makeRequest();
              taskA.Wait();
              Console.WriteLine("after the wait");
            }
          }
        }
        
      7. observe the filename is not UTF-8 encoded -> è¡å¨è®¡å 27 Oct 2017.pdf (see brokenScenario.png)

      Both import methods use the FileManager.Import operation so it is very unlikely to be the culprit.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour
                  1d 1h