diff --git a/aegilib/aegilib.vcproj b/aegilib/aegilib.vcproj
index 6949467ae3bb9641f7bd7fc4ef293dd19e17c391..6211d1fd2a690d75e10b1eae9d99b3510a252e65 100644
--- a/aegilib/aegilib.vcproj
+++ b/aegilib/aegilib.vcproj
@@ -183,6 +183,14 @@
 				RelativePath=".\include\aegilib\format.h"
 				>
 			</File>
+			<File
+				RelativePath=".\include\aegilib\format_handler.h"
+				>
+			</File>
+			<File
+				RelativePath=".\include\aegilib\format_manager.h"
+				>
+			</File>
 			<File
 				RelativePath=".\include\aegilib\manipulator.h"
 				>
@@ -235,6 +243,10 @@
 				RelativePath=".\src\exception.cpp"
 				>
 			</File>
+			<File
+				RelativePath=".\src\format_manager.cpp"
+				>
+			</File>
 			<File
 				RelativePath=".\src\prec.cpp"
 				>
@@ -261,6 +273,18 @@
 				>
 			</File>
 		</Filter>
+		<Filter
+			Name="Formats"
+			>
+			<File
+				RelativePath=".\src\formats\format_ass.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\src\formats\format_ass.h"
+				>
+			</File>
+		</Filter>
 	</Files>
 	<Globals>
 	</Globals>
diff --git a/aegilib/include/aegilib/aegilib.h b/aegilib/include/aegilib/aegilib.h
index fbc649be7f6f858d83a311c3c1a5c9b95fce1b82..b666ef2ac5de296182d29cbcfc7c47e5d6086cd7 100644
--- a/aegilib/include/aegilib/aegilib.h
+++ b/aegilib/include/aegilib/aegilib.h
@@ -40,5 +40,7 @@
 #include "notification.h"
 #include "aegistring.h"
 #include "format.h"
+#include "format_handler.h"
+#include "format_manager.h"
 #include "manipulator.h"
 #include "exception.h"
diff --git a/aegilib/include/aegilib/aegistring.h b/aegilib/include/aegilib/aegistring.h
index f1d774872600dffd8efadd98dd0eedf0e2d621f5..0e893a5bfe11c906b81b36d04b45a44308a32caf 100644
--- a/aegilib/include/aegilib/aegistring.h
+++ b/aegilib/include/aegilib/aegistring.h
@@ -35,9 +35,12 @@
 
 #pragma once
 
+#include <wx/string.h>
+
 namespace Aegilib {
 
 	// Define the string type used throughout this library
-	typedef std::basic_string<wchar_t> String;
+	//typedef std::basic_string<wchar_t> String;
+	typedef wxString String;
 
 };
diff --git a/aegilib/include/aegilib/format.h b/aegilib/include/aegilib/format.h
index 1488463f9a84b5712daf53158b44b2638eaf4bb9..1ade114511668f2f4d04ba04d639a60839e6d47a 100644
--- a/aegilib/include/aegilib/format.h
+++ b/aegilib/include/aegilib/format.h
@@ -39,15 +39,16 @@
 namespace Aegilib {
 	// Prototypes
 	class FormatHandler;
+	class Model;
 
 	// Format interface
 	class Format {
 	public:
-		virtual ~Format();
+		virtual ~Format() {}
 
 		virtual String GetName() const = 0;
-		virtual String GetExtensionWildcard() const = 0;
-		virtual const FormatHandler& GetHandler() const = 0;
+		virtual String GetExtension() const = 0;
+		virtual FormatHandler* GetHandler(const Model &model) const = 0;
 
 		virtual bool CanStoreText() const { return false; }
 		virtual bool CanStoreImages() const { return false; }
diff --git a/aegilib/include/aegilib/format_handler.h b/aegilib/include/aegilib/format_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c7af0d51ba3c57331191bcd4d4847b3b33e0aaa
--- /dev/null
+++ b/aegilib/include/aegilib/format_handler.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2008, Rodrigo Braz Monteiro
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+//   * Redistributions of source code must retain the above copyright notice,
+//     this list of conditions and the following disclaimer.
+//   * Redistributions in binary form must reproduce the above copyright notice,
+//     this list of conditions and the following disclaimer in the documentation
+//     and/or other materials provided with the distribution.
+//   * Neither the name of the Aegisub Group nor the names of its contributors
+//     may be used to endorse or promote products derived from this software
+//     without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+// -----------------------------------------------------------------------------
+//
+// AEGISUB/AEGILIB
+//
+// Website: http://www.aegisub.net
+// Contact: mailto:amz@aegisub.net
+//
+
+#pragma once
+#include "aegistring.h"
+
+namespace Aegilib {
+
+	// Format handler interface
+	class FormatHandler {
+	public:
+		virtual ~FormatHandler() {}
+
+		virtual void Load(wxInputStream &file,const String encoding) = 0;
+	};
+
+};
diff --git a/aegilib/include/aegilib/format_manager.h b/aegilib/include/aegilib/format_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..5893253ec53449ebe28eed04d8f0e64f7d3803a4
--- /dev/null
+++ b/aegilib/include/aegilib/format_manager.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2008, Rodrigo Braz Monteiro
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+//   * Redistributions of source code must retain the above copyright notice,
+//     this list of conditions and the following disclaimer.
+//   * Redistributions in binary form must reproduce the above copyright notice,
+//     this list of conditions and the following disclaimer in the documentation
+//     and/or other materials provided with the distribution.
+//   * Neither the name of the Aegisub Group nor the names of its contributors
+//     may be used to endorse or promote products derived from this software
+//     without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+// -----------------------------------------------------------------------------
+//
+// AEGISUB/AEGILIB
+//
+// Website: http://www.aegisub.net
+// Contact: mailto:amz@aegisub.net
+//
+
+#pragma once
+#include "format.h"
+
+namespace Aegilib {
+
+	// Format manager class
+	class FormatManager {
+	private:
+		static std::vector<const Format*> formats;
+		FormatManager() {}
+
+	public:
+		static void AddFormat(const Format *format);
+		static void InitializeFormats();
+		static void ClearFormats();
+
+		static int GetFormatCount();
+		static const Format* GetFormatByIndex(const int index);
+		static const Format* GetFormatFromFilename(const String &filename);
+		static const Format* GetFormatFromName(const String &name);
+	};
+
+};
diff --git a/aegilib/include/aegilib/model.h b/aegilib/include/aegilib/model.h
index 37b86b039a8ad4fc0f8ae27997605799fe7be6ac..b23ea2b92934b0f62a3bd65e7aea557e40fcc2a0 100644
--- a/aegilib/include/aegilib/model.h
+++ b/aegilib/include/aegilib/model.h
@@ -35,6 +35,7 @@
 
 #pragma once
 #include <list>
+#include <wx/stream.h>
 #include "manipulator.h"
 #include "file.h"
 
@@ -65,13 +66,13 @@ namespace Aegilib {
 		const Format& GetFormat() const;
 		void AddListener(View *listener);
 
-		void LoadFile(FileReader &file,Format *format=NULL);
-		void SaveFile(FileWriter &file,Format *format=NULL);
+		void LoadFile(wxInputStream &input,const Format *format=NULL,const String encoding=L"");
+		void SaveFile(wxOutputStream &output,const Format *format=NULL,const String encoding=L"UTF-8");
 
-		bool CanUndo(String owner=L"") const;
-		bool CanRedo(String owner=L"") const;
-		bool Undo(String owner=L"");
-		bool Redo(String owner=L"");
+		bool CanUndo(const String owner=L"") const;
+		bool CanRedo(const String owner=L"") const;
+		bool Undo(const String owner=L"");
+		bool Redo(const String owner=L"");
 	};
 
 };
diff --git a/aegilib/src/format_manager.cpp b/aegilib/src/format_manager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f6a35ab76b860bce6ef9194a2aecd2fcb478f681
--- /dev/null
+++ b/aegilib/src/format_manager.cpp
@@ -0,0 +1,114 @@
+// Copyright (c) 2008, Rodrigo Braz Monteiro
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+//   * Redistributions of source code must retain the above copyright notice,
+//     this list of conditions and the following disclaimer.
+//   * Redistributions in binary form must reproduce the above copyright notice,
+//     this list of conditions and the following disclaimer in the documentation
+//     and/or other materials provided with the distribution.
+//   * Neither the name of the Aegisub Group nor the names of its contributors
+//     may be used to endorse or promote products derived from this software
+//     without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+// -----------------------------------------------------------------------------
+//
+// AEGISUB/AEGILIB
+//
+// Website: http://www.aegisub.net
+// Contact: mailto:amz@aegisub.net
+//
+
+#include "format_manager.h"
+#include "formats/format_ass.h"
+#include <wx/string.h>
+using namespace Aegilib;
+
+
+////////
+// List
+std::vector<const Format*> FormatManager::formats;
+
+
+////////////////
+// Add a format
+void FormatManager::AddFormat(const Format *format)
+{
+	formats.push_back(format);
+}
+
+
+///////////////////////////////////
+// Initialzie all built-in formats
+void FormatManager::InitializeFormats()
+{
+	formats.push_back(new FormatASS);
+}
+
+
+///////////////////////
+// Removes all formats
+void FormatManager::ClearFormats()
+{
+	formats.clear();
+}
+
+
+/////////////////////
+// Number of formats
+int FormatManager::GetFormatCount()
+{
+	return (int) formats.size();
+}
+
+
+////////////
+// By index
+const Format* FormatManager::GetFormatByIndex(const int index)
+{
+	try {
+		return formats.at(index);
+	}
+	catch (...) {
+		return NULL;
+	}
+}
+
+
+///////////////
+// By filename
+const Format* FormatManager::GetFormatFromFilename(const String &filename)
+{
+	size_t len = formats.size();
+	for (size_t i=0;i<len;i++) {
+		if (filename.EndsWith(formats[i]->GetExtension())) return formats[i];
+	}
+	return NULL;
+}
+
+
+//////////////////
+// By format name
+const Format* FormatManager::GetFormatFromName(const String &name)
+{
+	size_t len = formats.size();
+	for (size_t i=0;i<len;i++) {
+		if (name == formats[i]->GetName()) return formats[i];
+	}
+	return NULL;
+}
+
diff --git a/aegilib/src/formats/format_ass.cpp b/aegilib/src/formats/format_ass.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7c64a705831c0b4a4dcd8ae0cdfec250cf3e85fe
--- /dev/null
+++ b/aegilib/src/formats/format_ass.cpp
@@ -0,0 +1,62 @@
+// Copyright (c) 2008, Rodrigo Braz Monteiro
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+//   * Redistributions of source code must retain the above copyright notice,
+//     this list of conditions and the following disclaimer.
+//   * Redistributions in binary form must reproduce the above copyright notice,
+//     this list of conditions and the following disclaimer in the documentation
+//     and/or other materials provided with the distribution.
+//   * Neither the name of the Aegisub Group nor the names of its contributors
+//     may be used to endorse or promote products derived from this software
+//     without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+// -----------------------------------------------------------------------------
+//
+// AEGISUB/AEGILIB
+//
+// Website: http://www.aegisub.net
+// Contact: mailto:amz@aegisub.net
+//
+
+#include "model.h"
+#include "format_ass.h"
+using namespace Aegilib;
+
+
+///////////////
+// Constructor
+FormatHandlerASS::FormatHandlerASS(const Model &model)
+{
+	(void) model;
+}
+
+
+//////////////
+// Destructor
+FormatHandlerASS::~FormatHandlerASS()
+{
+}
+
+
+///////////////
+// Load a file
+void FormatHandlerASS::Load(wxInputStream &file,const String encoding)
+{
+	(void) file;
+	(void) encoding;
+}
diff --git a/aegilib/src/formats/format_ass.h b/aegilib/src/formats/format_ass.h
new file mode 100644
index 0000000000000000000000000000000000000000..de97952539920d8c80174eb1ba89e0598ed37cab
--- /dev/null
+++ b/aegilib/src/formats/format_ass.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2008, Rodrigo Braz Monteiro
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+//   * Redistributions of source code must retain the above copyright notice,
+//     this list of conditions and the following disclaimer.
+//   * Redistributions in binary form must reproduce the above copyright notice,
+//     this list of conditions and the following disclaimer in the documentation
+//     and/or other materials provided with the distribution.
+//   * Neither the name of the Aegisub Group nor the names of its contributors
+//     may be used to endorse or promote products derived from this software
+//     without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+// -----------------------------------------------------------------------------
+//
+// AEGISUB/AEGILIB
+//
+// Website: http://www.aegisub.net
+// Contact: mailto:amz@aegisub.net
+//
+
+#pragma once
+#include "format.h"
+#include "format_handler.h"
+
+namespace Aegilib {
+
+	// Prototypes
+	class Model;
+
+	// Advanced Substation Alpha format handler
+	class FormatHandlerASS : public FormatHandler {
+	public:
+		FormatHandlerASS(const Model &model);
+		~FormatHandlerASS();
+
+		void Load(wxInputStream &file,const String encoding);
+	};
+
+	// Advanced Substation Alpha format
+	class FormatASS : public Format {
+	public:
+		String GetName() const { return L"Advanced Substation Alpha"; }
+		String GetExtension() const { return L".ass"; }
+		FormatHandler* GetHandler(const Model &model) const { return new FormatHandlerASS(model); }
+
+		bool CanStoreText() const { return true; }
+		bool CanUseTime() const { return true; }
+
+		bool HasStyles() const { return true; }
+		bool HasMargins() const { return true; }
+		bool HasActors() const { return true; }
+	};
+
+};
diff --git a/aegilib/src/model.cpp b/aegilib/src/model.cpp
index da3175c925d3a14ce90c9af14fca61500a3e3524..df2aaa8891f9ec17f0617deeb5cc64d0342dc669 100644
--- a/aegilib/src/model.cpp
+++ b/aegilib/src/model.cpp
@@ -86,26 +86,34 @@ Manipulator Model::CreateAntiManipulator(const Manipulator &src)
 
 ///////////////
 // Load a file
-void Model::LoadFile(FileReader &file,Format *format)
+void Model::LoadFile(wxInputStream &input,const Format *format,const String encoding)
 {
-	// Detect format
+	// Autodetect format
 	if (format == NULL) {
 		// TODO
+
+		// No format found
+		throw Exception(Exception::No_Format_Handler);
 	}
 
-	// No format found
-	throw Exception(Exception::No_Format_Handler);
+	// Get handler
+	FormatHandler *handler = format->GetHandler(*this);
+	if (!handler) throw Exception(Exception::No_Format_Handler);
 
 	// Load
-	(void) file;
+	handler->Load(input,encoding);
+
+	// Clean up
+	delete handler;
 }
 
 
 //////////////////
 // Save to a file
-void Model::SaveFile(FileWriter &file,Format *format)
+void Model::SaveFile(wxOutputStream &output,const Format *format,const String encoding)
 {
-	(void) file;
+	(void) output;
 	(void) format;
+	(void) encoding;
 	// TODO
 }
diff --git a/aegilib/test/src/main.cpp b/aegilib/test/src/main.cpp
index f8a11a7184cb4941463db8589d17d5f1775b7ffd..54e946c7d977be1ca1baae77fb463573297fc5f2 100644
--- a/aegilib/test/src/main.cpp
+++ b/aegilib/test/src/main.cpp
@@ -34,6 +34,7 @@
 //
 
 #include <aegilib/aegilib.h>
+#include <wx/wfstream.h>
 #include <iostream>
 #include "text_file_reader.h"
 #include "text_file_writer.h"
@@ -44,20 +45,33 @@ int main () {
 
 	cout << "Aegilib test program by amz.\n\n";
 
-	// Subtitles model
-	Model subs;
+	try {
+		// Set up the lib
+		FormatManager::InitializeFormats();
 
-	// Load subtitles
-	cout << "Loading file... ";
-	subs.LoadFile(TextFileReader(L"subs_in.ass"));
-	cout << "Done.\n";
+		// Subtitles model
+		Model subs;
 
-	// Modify subtitles
-	cout << "Modifying file...";
-	cout << "Done.\n";
+		// Load subtitles
+		cout << "Loading file... ";
+		String filename = L"subs_in.ass";
+		const Format *handler = FormatManager::GetFormatFromFilename(filename);
+		subs.LoadFile(wxFileInputStream(filename),handler);
+		cout << "Done.\n";
 
-	// Save subtitles
-	cout << "Saving file... ";
-	subs.SaveFile(TextFileWriter(L"subs_out.ass"));
-	cout << "Done.\n";
+		// Modify subtitles
+		cout << "Modifying file...";
+		cout << "Done.\n";
+
+		// Save subtitles
+		cout << "Saving file... ";
+		filename = L"subs_out.ass";
+		handler = FormatManager::GetFormatFromFilename(filename);
+		subs.SaveFile(wxFileOutputStream(filename),handler);
+		cout << "Done.\n";
+	}
+
+	catch (Exception &e) {
+		cout << "\n\nException: " << e.GetMessage().mb_str(wxConvUTF8) << endl << endl;
+	}
 }