No announcement yet.

Encoding of text files changes on copying

  • Filter
  • Time
  • Show
Clear All
new posts

  • Encoding of text files changes on copying

    Version: BC 4.1.3 on Windows 7 64-bit
    Remark: Didnīt find an according thread in the forum and also no according item in the BC options/settings.


    I mainly use folder compare sessions and manually copy files back and forth between the sides (selecting them and pressing the "Copy" button / Ctrl+L). This works fine for local folders and also between local drives and mapped network drives so far.

    But recently I used it having a remote SharePoint on one side and a network drive on the other side. When copying text files (txt, xml, aspx, ...) , their encoding seems to be converted, so the copies on the network drive are bigger than the original files on the SharePoint. For that reason they are shown as different. If you change the session settings to rules based comparison they are no longer shown as different. But I assume that this would increase the time it takes even more.

    The same conversion happens when I copy the files using the Windows Explorer, by the way. So probably BC just uses that process in the background.

    Question: Is there a ways to force binary copying without conversion? This may introduce some risks for subsequent file handling and processing, I know. But if you know what you are doing this may help in some cases.

    Thanks and best regards,

  • #2

    BC4 does use the same process as Windows Explorer, so if Explorer exhibits the issue, then BC4 will also hit it. The BC4/Explorer copy is intended to be a binary copy; your version/setup of Sharepoint is intercepting this and performing the conversion on its own.

    With criteria Rules-based scans, the visible text is loaded and compared and can ignore differences in encoding, so while this would take longer it can show your files as equal.

    If you have BC4 Pro, one of our Profile types is WebDAV. You could try connecting to Sharepoint using this method directly to see if there is different behavior. Or you could create a local drive letter to be bound to a Sharepoint WebDAV location and try copying with this protocol.

    Also, all BC4.x updates are free for 4.x users. You can update to the latest 4.1.9 for free or 4.2 beta.
    Aaron P Scooter Software


    • #3
      I get a strange behavior here.
      I've mapped my sharepoint list to a drive letter, but I have two different behaviors.

      When using the GUI I'm able to correctly load the content of a sharepoint list, then I can also copy files from my LAN share to the drive letter mapped to sharepoint.

      When using a script, I cannot load the content of the sharepoint list.

      Here is the script.
      log verbose append:"C:\Users\adminss\Desktop\LOGS\NAS09_TO_SHA REPOINT\NAS09_to_SHAREPOINT_Log_%date%.txt"

      load "\\nas09\storico" "Z:"

      expand all

      select all

      criteria timestamp size

      sync create-empty mirror:left->right

      Then I get the following error in the log.
      03/05/2017 10:13:57 >> log verbose append:"C:\Users\adminss\Desktop\LOGS\NAS09_TO_SHA REPOINT\NAS09_to_Log_2017-05-03.txt"
      03/05/2017 10:13:57 >>
      03/05/2017 10:13:57 >> load "\\nas09\storico" "Z:"
      03/05/2017 10:13:58 Unable to load Z:\: The requested operation has not been executed because the user has not been authenticated
      03/05/2017 10:13:58 Load comparison: \\NAS09\storico <->
      03/05/2017 10:13:58 Fatal Scripting Error: Unable to load base folder
      03/05/2017 10:13:58 Script completed in 1 seconds

      Also, I'm not able to map my sharepoint list through the "Profile" option in Tools (Pro Version only).
      I think the only way should be through WebDAV, but all the combination of the URL i try does not work.

      Dou you have any suggestion?



      • #4

        When you initially connected in the graphical interface, were there any user/password or other prompts?

        If you create a Portable Install with the setup.exe, and reattempt to connect, does this pop up any extra prompts during the first connection? Assuming yes, if you then use this Portable Install for the automated script, does it then connect?

        My hunch is that script may be running as a different user or isn't able to access the saved credentials in the graphical interface, which the Portable Install can access regardless of which user runs it.
        Aaron P Scooter Software


        • #5
          the only way I know to mount a sharepoint list in the windows explorer is to:
          - start the Web Client Service
          - add * to the list of the trusted sites into internet explorer
          - Log in into sharepoint through Internet explorer and save the password

          Then, from that moment, you are able to map the sharepoint list to a drive letter.
          The grace period (do not know exactly how long) lasts until a certain period passes between two accesses to the drive.

          As mentioned, I can confirm that launching the script mentioned (without the task scheduler), directly from the command line as a logged user, the sync works!
          C:\Program Files\Beyond Compare 4\BCompare.exe @C:\Users\adminss\Desktop\NAS09_TO_SHAREPOINT.txt

          Therefore, the problem is related to the fact that, when the script is launched with the task scheduler, it loses in some way the authentication given by the log in into internet explorer, I guess.

          I've never been able to access sharepoint through WebDAV.
          Moreover, considering the service you provide for OneDrive, I guess it only works for Private users...
          The sharepoint I need to map belongs to a company, so I think it should works with OneDrive for business too (but I think recently Microsoft merged the two things).

          In the end, what's the easier way to make things working?


          N.B. I forgot to mention that among the options set in the Task Scheduler I've set "Run it independenty from the user login"
          Maybe the problem stands here
          Last edited by kinobijei; 03-May-2017, 11:55 AM.


          • #6

            OneDrive and OneDrive For Business are two separate protocols with similar names, so our OneDrive support is only for the personal level. With OneDrive for Business, your method is similar to how I've gotten it to work in the past, and it does require Internet Explorer authentication periodically (there doesn't seem to be any workaround for that, even for Windows Explorer access).

            I'm going to guess that Run without a logged in user wouldn't work, as the saved credentials would be per Windows User account. If you toggle that option off, does this help get the script running every time (until it hits the eventual credentials timeout a few days from now)?
            Aaron P Scooter Software


            • #7
              Hello Aaron,
              I can confirm that launching the script with task scehduler as logged in user works.
              Nowadays, Is this the only solution I can adopt to get it working?
              No other way to specify the credentials in the script?

              Do you know if in the future releases of Beyond Compare, Microsoft Sharepoint Online and OneDrive for business will be supported?

              Thank you


              • #8

                Not that I'm aware of. Even Windows Explorer requires the credentials to be saved by logging and saving as part of Internet Explorer, so it's not a BC4 specific issue but how OneDrive for Business operates. Adding full support for OneDrive for Business is something on our wishlist, but is an entirely different protocol than OneDrive. They have been named similarly, but (as you've found) are fundamentally different services with different feature sets.
                Aaron P Scooter Software


                • #9
                  Beyond Compare 4.2.9 is now available, it should support OneDrive for Business.
                  Chris K Scooter Software