Move PBD::canonical_path to pbd/file_utils.h/cc and reimplement for Windows
authorTim Mayberry <mojofunk@gmail.com>
Mon, 19 Sep 2016 00:11:59 +0000 (10:11 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Mon, 19 Sep 2016 04:47:52 +0000 (14:47 +1000)
commit569167a603ef812a234d3c02f6a94976571a70ea
treeecb02ab54ca4852118bed1a0c1005bf567708478
parent75ade6b2df3926b965f5af6ec6d7ed8659167b73
Move PBD::canonical_path to pbd/file_utils.h/cc and reimplement for Windows

This fixes the libpbd testCanonicalPathUTF8 and libardour
open_session_utf8_path unit tests

You can now have Sessions with localized names containing characters that
aren't in the system codepage on Windows.

It also fixes the issue where a Session would not open when it was moved into a
path with characters that aren't in the system codepage.

The only use case for calling canonical_path/realpath on the session path
AFAICT is for resolving relative paths that are passed via the command
line/terminal. I'm doubtful that works correctly on Windows because of
character encoding issues with the current API we use for that(not glib), so it
is slightly ironic that this issue was caused by an incorrect implementation of
a function that is not really necessary on Windows at this point in time.
libs/pbd/file_utils.cc
libs/pbd/pathexpand.cc
libs/pbd/pbd/file_utils.h