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

Fix extended set characters as file name to be correctly encoded

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-beta-44070
    • Fix Version/s: 1.0.0-beta-64050
    • Component/s: Core

      Description

      Using the following client code in VS 2019 (DotNet 4.6.1 as a target) and .Net NuxelClient 1.0.0-beta-44070, the filename property is not displayed correctly in Nuxeo due to a wrong UTF-8 conversion

      .Net C# code

      using System;
      using NuxeoClient;
      using NuxeoClient.Wrappers;
      
      namespace myApp
      {
          class Program
          {
              static async System.Threading.Tasks.Task Main(string[] args)
              {
                  Console.WriteLine("Hello World!");
                  Console.WriteLine("The current time is " + DateTime.Now);
      
                  Client client = new Client("http://localhost:8080/nuxeo/",
                              new Authorization("Administrator",
                                                "Administrator"));
                  Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
      
                  Blob blobV = Blob.FromFile(".\\DSC00388.JPG")
                                      .SetFilename("ÅÄÖåäö")
                                      //.SetFilename("AAOaao")
                                      //.SetFilename("éèçàùµ")
                                      .SetMimeType("image/jpg");
                  Console.WriteLine(blobV);
      
      
                  // Do any async anything you need here without worry
                  var myVisningsFil = await client.Operation("Blob.AttachOnDocument")
                                                      .SetParameter("document", "4779be1d-9dea-4e87-a98a-dfba92e04985")
                                                      .SetParameter("xpath", "file:content")
                                                      .SetInput(blobV)
                                                      .Execute();
      
              }
      
          }
      }
      

      Suggested fix:
      in Client.cs, line 581:
      https://github.com/nuxeo/nuxeo-dotnet-client/blob/master/src/NuxeoClient/Client.cs#L581 changing:

                      FileName = blob.Filename
      

      into

                      FileNameStar = blob.Filename
      

      fixes the filename issue in Nuxeo in the environment in which I reproduce the issue.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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