Set up for the correct handling of UTF-8 with Windows
[dcpomatic.git] / src / tools / dcpomatic_server.cc
index 58310377c04301774b7c77120e334d804a17b094..e10fd313814cdad562fcb84077e0f6c73934eaca 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ public:
        }
 
        string head_and_tail (int amount = 1024) const {
-               if (_log.size () < (2 * amount)) {
+               if (int (_log.size ()) < (2 * amount)) {
                        return _log;
                }
 
@@ -61,7 +61,7 @@ private:
                _log = m;
        }
 
-       string _log;    
+       string _log;
 };
 
 static shared_ptr<MemoryLog> memory_log (new MemoryLog);
@@ -103,24 +103,24 @@ class TaskBarIcon : public wxTaskBarIcon
 public:
        TaskBarIcon ()
        {
-#ifdef __WXMSW__               
+#ifdef __WXMSW__
                wxIcon icon (std_to_wx ("taskbar_icon"));
 #endif
 #ifdef __WXGTK__
                wxInitAllImageHandlers();
-               wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG);
+               wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), LINUX_SHARE_PREFIX), wxBITMAP_TYPE_PNG);
                wxIcon icon;
                icon.CopyFromBitmap (bitmap);
 #endif
 #ifndef __WXOSX__
                /* XXX: fix this for OS X */
                SetIcon (icon, std_to_wx ("DCP-o-matic encode server"));
-#endif         
+#endif
 
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::status, this), ID_status);
                Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::quit, this), ID_quit);
        }
-       
+
        wxMenu* CreatePopupMenu ()
        {
                wxMenu* menu = new wxMenu;
@@ -151,14 +151,15 @@ public:
                , _icon (0)
        {}
 
-private:       
-       
+private:
+
        bool OnInit ()
        {
                if (!wxApp::OnInit ()) {
                        return false;
                }
-               
+
+               dcpomatic_setup_path_encoding ();
                dcpomatic_setup ();
 
                _icon = new TaskBarIcon;
@@ -167,7 +168,7 @@ private:
                Bind (wxEVT_TIMER, boost::bind (&App::check, this));
                _timer.reset (new wxTimer (this));
                _timer->Start (1000);
-               
+
                return true;
        }