diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 0f574efa5877cf4878479064b28f8d9276fc993b..afba1d7e0236c55259d93d02e30c49d8f71d0c47 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -250,7 +250,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
 		if(wargv[ii][1] == '-') ++offset;
 
 #if LL_WINDOWS
-	name.assign(utf16str_to_utf8str(&wargv[ii][offset]));
+	name.assign(ll_convert_wide_to_string(&wargv[ii][offset]));
 #else
 	name.assign(wstring_to_utf8str(&wargv[ii][offset]));
 #endif
@@ -274,7 +274,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
 		++ii;
 
 #if LL_WINDOWS
-	value.assign(utf16str_to_utf8str((wargv[ii])));
+	value.assign(ll_convert_wide_to_string((wargv[ii])));
 #else
 	value.assign(wstring_to_utf8str((wargv[ii])));
 #endif
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index a07a93b9fa1ab840860cf3eca22c4e41272242a8..ff8cfe4745fb0a132c0bd553111880c661582b25 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -79,7 +79,7 @@ namespace {
 			//
 			if (s.size())
 			{
-				OutputDebugString(utf8str_to_utf16str(s).c_str());
+				OutputDebugString(ll_convert_string_to_wide(s).c_str());
 				OutputDebugString(TEXT("\n"));
 			}
 		}
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 8355b1e797ea14946da3d3cc69b590f38fbbc8e2..66826ae894dccd4bd021ab010be1898c388634b7 100644
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -179,7 +179,7 @@ int	LLFile::mkdir(const std::string& dirname, int perms)
 #if LL_WINDOWS
 	// permissions are ignored on Windows
 	std::string utf8dirname = dirname;
-	llutf16string utf16dirname = utf8str_to_utf16str(utf8dirname);
+	std::wstring utf16dirname = ll_convert_string_to_wide(utf8dirname);
 	int rc = _wmkdir(utf16dirname.c_str());
 #else
 	int rc = ::mkdir(dirname.c_str(), (mode_t)perms);
@@ -202,7 +202,7 @@ int	LLFile::rmdir(const std::string& dirname)
 #if LL_WINDOWS
 	// permissions are ignored on Windows
 	std::string utf8dirname = dirname;
-	llutf16string utf16dirname = utf8str_to_utf16str(utf8dirname);
+	std::wstring utf16dirname = ll_convert_string_to_wide(utf8dirname);
 	int rc = _wrmdir(utf16dirname.c_str());
 #else
 	int rc = ::rmdir(dirname.c_str());
@@ -216,8 +216,8 @@ LLFILE*	LLFile::fopen(const std::string& filename, const char* mode)	/* Flawfind
 #if	LL_WINDOWS
 	std::string utf8filename = filename;
 	std::string utf8mode = std::string(mode);
-	llutf16string utf16filename = utf8str_to_utf16str(utf8filename);
-	llutf16string utf16mode = utf8str_to_utf16str(utf8mode);
+	std::wstring utf16filename = ll_convert_string_to_wide(utf8filename);
+	std::wstring utf16mode = ll_convert_string_to_wide(utf8mode);
 	return _wfopen(utf16filename.c_str(),utf16mode.c_str());
 #else
 	return ::fopen(filename.c_str(),mode);	/* Flawfinder: ignore */
@@ -229,8 +229,8 @@ LLFILE*	LLFile::_fsopen(const std::string& filename, const char* mode, int shari
 #if	LL_WINDOWS
 	std::string utf8filename = filename;
 	std::string utf8mode = std::string(mode);
-	llutf16string utf16filename = utf8str_to_utf16str(utf8filename);
-	llutf16string utf16mode = utf8str_to_utf16str(utf8mode);
+	std::wstring utf16filename = ll_convert_string_to_wide(utf8filename);
+	std::wstring utf16mode = ll_convert_string_to_wide(utf8mode);
 	return _wfsopen(utf16filename.c_str(),utf16mode.c_str(),sharingFlag);
 #else
 	llassert(0);//No corresponding function on non-windows
@@ -253,7 +253,7 @@ int	LLFile::remove(const std::string& filename, int supress_error)
 {
 #if	LL_WINDOWS
 	std::string utf8filename = filename;
-	llutf16string utf16filename = utf8str_to_utf16str(utf8filename);
+	std::wstring utf16filename = ll_convert_string_to_wide(utf8filename);
 	int rc = _wremove(utf16filename.c_str());
 #else
 	int rc = ::remove(filename.c_str());
@@ -266,8 +266,8 @@ int	LLFile::rename(const std::string& filename, const std::string& newname, int
 #if	LL_WINDOWS
 	std::string utf8filename = filename;
 	std::string utf8newname = newname;
-	llutf16string utf16filename = utf8str_to_utf16str(utf8filename);
-	llutf16string utf16newname = utf8str_to_utf16str(utf8newname);
+	std::wstring utf16filename = ll_convert_string_to_wide(utf8filename);
+	std::wstring utf16newname = ll_convert_string_to_wide(utf8newname);
 	int rc = _wrename(utf16filename.c_str(),utf16newname.c_str());
 #else
 	int rc = ::rename(filename.c_str(),newname.c_str());
@@ -310,7 +310,7 @@ int	LLFile::stat(const std::string& filename, llstat* filestatus)
 {
 #if LL_WINDOWS
 	std::string utf8filename = filename;
-	llutf16string utf16filename = utf8str_to_utf16str(utf8filename);
+	std::wstring utf16filename = ll_convert_string_to_wide(utf8filename);
 	int rc = _wstat(utf16filename.c_str(),filestatus);
 #else
 	int rc = ::stat(filename.c_str(),filestatus);
diff --git a/indra/llcommon/stringize.h b/indra/llcommon/stringize.h
index 38dd198ad319760c3be12230b1dfe2975421a9d9..16b4227d610dd174e693f6d0442a7e3a2db57c70 100644
--- a/indra/llcommon/stringize.h
+++ b/indra/llcommon/stringize.h
@@ -50,10 +50,10 @@ std::basic_string<CHARTYPE> gstringize(const T& item)
  *partial specialization of stringize for handling wstring
  *TODO: we should have similar specializations for wchar_t[] but not until it is needed.
  */
-inline std::string stringize(const std::wstring& item)
-{
-    return wstring_to_utf8str(item);
-}
+//inline std::string stringize(const std::wstring& item)
+//{
+//    return wstring_to_utf8str(item);
+//}
 
 /**
  * Specialization of gstringize for std::string return types
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index fd9182d924a4e30868a84d90e823ab20692fd082..b20ec5a4333dabbf782539c0336015765a766783 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -106,7 +106,7 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname)
     //Returns a vector of fullpath filenames.
 
 #ifdef LL_WINDOWS // or BOOST_WINDOWS_API
-    boost::filesystem::path p(utf8str_to_utf16str(dirname));
+    boost::filesystem::path p(ll_convert_string_to_wide(dirname));
 #else
     boost::filesystem::path p(dirname);
 #endif
@@ -199,7 +199,7 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
 	try
 	{
 #ifdef LL_WINDOWS // or BOOST_WINDOWS_API
-		boost::filesystem::path dir_path(utf8str_to_utf16str(dir_name));
+		boost::filesystem::path dir_path(ll_convert_string_to_wide(dir_name));
 #else
 		boost::filesystem::path dir_path(dir_name);
 #endif
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 32cb8f57a7568697268484ab4258125d1b768402..8c9690a33589b334c3445d616178b03af8f08dca 100644
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -171,7 +171,7 @@ LLDir_Win32::LLDir_Win32()
 		{
 			w_str[wcslen(w_str)-1] = '\0'; /* Flawfinder: ignore */ // remove trailing slash
 		}
-		mTempDir = utf16str_to_utf8str(llutf16string(w_str));
+		mTempDir = ll_convert_wide_to_string(std::wstring(w_str));
 
 		if (mOSUserDir.empty())
 		{
@@ -224,14 +224,14 @@ LLDir_Win32::LLDir_Win32()
 
 	// Set working directory, for LLDir::getWorkingDir()
 	GetCurrentDirectory(MAX_PATH, w_str);
-	mWorkingDir = utf16str_to_utf8str(llutf16string(w_str));
+	mWorkingDir = ll_convert_wide_to_string(std::wstring(w_str));
 
 	// Set the executable directory
 	S32 size = GetModuleFileName(NULL, w_str, MAX_PATH);
 	if (size)
 	{
 		w_str[size] = '\0';
-		mExecutablePathAndName = utf16str_to_utf8str(llutf16string(w_str));
+		mExecutablePathAndName = ll_convert_wide_to_string(std::wstring(w_str));
 		S32 path_end = mExecutablePathAndName.find_last_of('\\');
 		if (path_end != std::string::npos)
 		{
@@ -346,8 +346,8 @@ U32 LLDir_Win32::countFilesInDir(const std::string &dirname, const std::string &
 
 	WIN32_FIND_DATA FileData;
 
-	llutf16string pathname = utf8str_to_utf16str(dirname);
-	pathname += utf8str_to_utf16str(mask);
+	std::wstring pathname = ll_convert_string_to_wide(dirname);
+	pathname += ll_convert_string_to_wide(mask);
 	
 	if ((count_search_h = FindFirstFile(pathname.c_str(), &FileData)) != INVALID_HANDLE_VALUE)   
 	{
@@ -369,7 +369,7 @@ std::string LLDir_Win32::getCurPath()
 	WCHAR w_str[MAX_PATH];
 	GetCurrentDirectory(MAX_PATH, w_str);
 
-	return utf16str_to_utf8str(llutf16string(w_str));
+	return ll_convert_wide_to_string(std::wstring(w_str));
 }
 
 
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index cbd67afaef0c594a33a3c05197074aa70fab3d89..55cbfa3d02ac612a529f008841ada8908f108ff9 100644
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -52,7 +52,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
 	: mIsValid(false)
 {
 #ifdef LL_WINDOWS // or BOOST_WINDOWS_API
-	fs::path dir_path(utf8str_to_utf16str(dirname));
+	fs::path dir_path(ll_convert_string_to_wide(dirname));
 #else
 	fs::path dir_path(dirname);
 #endif
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index cc76e6907c51dceccd5169dddc788f61e919d08b..6a84384b45a1ac69e021ab58a3b2aba2930d1428 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -3111,7 +3111,7 @@ BOOL LLWindowWin32::pasteTextFromClipboard(LLWString &dst)
 				WCHAR *utf16str = (WCHAR*) GlobalLock(h_data);
 				if (utf16str)
 				{
-					dst = utf16str_to_wstring(utf16str);
+					dst = utf8str_to_wstring(ll_convert_wide_to_string(utf16str));
 					LLWStringUtil::removeWindowsCR(dst);
 					GlobalUnlock(h_data);
 					success = TRUE;
@@ -3970,7 +3970,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes)
 			size = LLWinImm::getCompositionString(himc, GCS_RESULTSTR, data, size);
 			if (size > 0)
 			{
-				result_string = utf16str_to_wstring(llutf16string(data, size / sizeof(WCHAR)));
+				result_string = utf8str_to_wstring(ll_convert_wide_to_string(std::wstring(data, size / sizeof(WCHAR))));
 			}
 			delete[] data;
 			needs_update = TRUE;
@@ -3987,7 +3987,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes)
 			if (size > 0)
 			{
 				preedit_string_utf16_length = size / sizeof(WCHAR);
-				preedit_string = utf16str_to_wstring(llutf16string(data, size / sizeof(WCHAR)));
+				preedit_string = utf8str_to_wstring(ll_convert_wide_to_string(std::wstring(data, size / sizeof(WCHAR))));
 			}
 			delete[] data;
 			needs_update = TRUE;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index d0c19793865f195b15d08572c5664de09565d83e..eb81dfe510404245c20a58d8dc2d5e2ad6896395 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4151,7 +4151,7 @@ void dumpVFSCaches()
 	{
 		LL_WARNS() << "Couldn't create dir StaticVFSDump" << LL_ENDL;
 	}
-	SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str());
+	SetCurrentDirectory(ll_convert_string_to_wide("StaticVFSDump").c_str());
 	gStaticVFS->dumpFiles();
 	SetCurrentDirectory(w_str);
 #endif
@@ -4165,7 +4165,7 @@ void dumpVFSCaches()
 	{
 		LL_WARNS() << "Couldn't create dir VFSDump" << LL_ENDL;
 	}
-	SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str());
+	SetCurrentDirectory(ll_convert_string_to_wide("VFSDump").c_str());
 	gVFS->dumpFiles();
 	SetCurrentDirectory(w_str);
 #endif
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index cc89899c7fc4b875674f135447179fa2e0d71a40..ab6ac12573fa64a947a30d1795973aacec50129c 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -200,20 +200,6 @@ extern "C" {
 
 const std::string LLAppViewerWin32::sWindowClass = "Alchemy";
 
-/*
-    This function is used to print to the command line a text message 
-    describing the nvapi error and quits
-*/
-void nvapi_error(NvAPI_Status status)
-{
-    NvAPI_ShortString szDesc = {0};
-	NvAPI_GetErrorMessage(status, szDesc);
-	LL_WARNS() << szDesc << LL_ENDL;
-
-	//should always trigger when asserts are enabled
-	//llassert(status == NVAPI_OK);
-}
-
 // Create app mutex creates a unique global windows object. 
 // If the object can be created it returns true, otherwise
 // it returns false. The false result can be used to determine 
@@ -235,6 +221,22 @@ bool create_app_mutex()
 	return result;
 }
 
+#define NVAPI_APPNAME L"Second Life"
+
+/*
+	This function is used to print to the command line a text message
+	describing the nvapi error and quits
+*/
+void nvapi_error(NvAPI_Status status)
+{
+	NvAPI_ShortString szDesc = { 0 };
+	NvAPI_GetErrorMessage(status, szDesc);
+	LL_WARNS() << szDesc << LL_ENDL;
+
+	//should always trigger when asserts are enabled
+	//llassert(status == NVAPI_OK);
+}
+
 void ll_nvapi_init(NvDRSSessionHandle hSession)
 {
 	// (2) load all the system settings into the session
@@ -245,11 +247,9 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
 		return;
 	}
 
-	NvAPI_UnicodeString profile_name;
-	std::string app_name = LLTrans::getString("APP_NAME");
-	llutf16string w_app_name = utf8str_to_utf16str(app_name);
-	wsprintf(profile_name, L"%s", w_app_name.c_str());
-	status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name);
+	NvAPI_UnicodeString wsz = { 0 };
+	memcpy_s(wsz, sizeof(wsz), NVAPI_APPNAME, sizeof(NVAPI_APPNAME));
+	status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, wsz);
 	if (status != NVAPI_OK)
 	{
 		nvapi_error(status);
@@ -483,7 +483,7 @@ void LLAppViewerWin32::disableWinErrorReporting()
 {
 	std::string executable_name = gDirUtilp->getExecutableFilename();
 
-	if( S_OK == WerAddExcludedApplication( utf8str_to_utf16str(executable_name).c_str(), FALSE ) )
+	if( S_OK == WerAddExcludedApplication( ll_convert_string_to_wide(executable_name).c_str(), FALSE ) )
 	{
 		LL_INFOS() << "WerAddExcludedApplication() succeeded for " << executable_name << LL_ENDL;
 	}
@@ -807,10 +807,10 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze)
 	PROCESS_INFORMATION processInfo;
 
 	std::wstring exe_wstr;
-	exe_wstr = utf8str_to_utf16str(exe_path);
+	exe_wstr = ll_convert_string_to_wide(exe_path);
 
 	std::wstring arg_wstr;
-	arg_wstr = utf8str_to_utf16str(arg_str);
+	arg_wstr = ll_convert_string_to_wide(arg_str);
 
 	LL_INFOS("CrashReport") << "Creating crash reporter process " << exe_path << " with params: " << arg_str << LL_ENDL;
     if(CreateProcess(exe_wstr.c_str(),     
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index b8e6e81ee6695c92f5239d0d1d3f1c118226e652..b4b96c5553bb07e4639f4b45523c93bd0153782a 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -127,7 +127,7 @@ BOOL LLDirPicker::getDir(std::string* filename, bool blocking)
 		{
 			// Set the string value.
 
-			mDir = utf16str_to_utf8str(llutf16string(buffer));
+			mDir = ll_convert_wide_to_string(std::wstring(buffer));
 			success = TRUE;
 		}
 		// free the item id list
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 5702936a956c7855abe254989b9299ecebac97d1..d5955796a4a3ebe5ae237ca9864c25cc1704943e 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -276,7 +276,7 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
 	success = GetOpenFileName(&mOFN);
 	if (success)
 	{
-		std::string filename = utf16str_to_utf8str(llutf16string(mFilesW));
+		std::string filename = ll_convert_wide_to_string(std::wstring(mFilesW));
 		mFiles.push_back(filename);
 	}
 
@@ -333,7 +333,7 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
 		// lengths.
 		if( wcslen(mOFN.lpstrFile) > mOFN.nFileOffset )	/*Flawfinder: ignore*/
 		{
-			std::string filename = utf16str_to_utf8str(llutf16string(mFilesW));
+			std::string filename = ll_convert_wide_to_string(std::wstring(mFilesW));
 			mFiles.push_back(filename);
 		}
 		else
@@ -347,7 +347,7 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
 					break;
 				if (*tptrw == 0)
 					tptrw++; // shouldn't happen?
-				std::string filename = utf16str_to_utf8str(llutf16string(tptrw));
+				std::string filename = ll_convert_wide_to_string(std::wstring(tptrw));
 				if (dirname.empty())
 					dirname = filename + "\\";
 				else
@@ -384,7 +384,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
 	mOFN.lpstrFile = mFilesW;
 	if (!filename.empty())
 	{
-		llutf16string tstring = utf8str_to_utf16str(filename);
+		std::wstring tstring = ll_convert_string_to_wide(filename);
 		wcsncpy(mFilesW, tstring.c_str(), FILENAME_BUFFER_SIZE);	}	/*Flawfinder: ignore*/
 	else
 	{
@@ -579,7 +579,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
 			success = GetSaveFileName(&mOFN);
 			if (success)
 			{
-				std::string filename = utf16str_to_utf8str(llutf16string(mFilesW));
+				std::string filename = ll_convert_wide_to_string(std::wstring(mFilesW));
 				mFiles.push_back(filename);
 			}
 		}
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 3714bc67352d7aa313e178b86c8cebf44db4aa75..287ae0140359d63d00d2e2ab3f8651f37d696bae 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -187,7 +187,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
 #ifndef LL_WINDOWS
 			const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(mFilename));
 #else
-			const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(mFilename)));
+			const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(ll_convert_string_to_wide(mFilename)));
 #endif
 			LLSD new_last_modified = asctime(localtime(&temp_time));
 
diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp
index 57a6ecb604c616f0b1ea1232f3b24343d09d89f1..5dcfbefb90c88589dd7de62c643f23a9ce8f017a 100644
--- a/indra/newview/llmachineid.cpp
+++ b/indra/newview/llmachineid.cpp
@@ -27,12 +27,12 @@
 #include "llviewerprecompiledheaders.h"
 #include "lluuid.h"
 #include "llmachineid.h"
+#include <system_error>
 #if	LL_WINDOWS
-#define _WIN32_DCOM
-#include <iostream>
-using namespace std;
-#include <comdef.h>
-#include <Wbemidl.h>
+#  define _WIN32_DCOM
+#  include <comdef.h>
+#  include <Wbemidl.h>
+
 #endif
 unsigned char static_unique_id[] =  {0,0,0,0,0,0};
 bool static has_static_unique_id = false;
@@ -47,7 +47,7 @@ class LLComInitialize
     {
         mHR = CoInitializeEx(0, COINIT_MULTITHREADED);
         if (FAILED(mHR))
-            LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL;
+            LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << mHR << LL_ENDL;
     }
 
     ~LLComInitialize()
@@ -105,7 +105,7 @@ S32 LLMachineID::init()
                           
         if (FAILED(hres))
         {
-            LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x"  << hex << hres << LL_ENDL;
+            LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x"  << std::hex << hres << LL_ENDL;
             return 1;                    // Program has failed.
         }
         
@@ -122,7 +122,7 @@ S32 LLMachineID::init()
      
         if (FAILED(hres))
         {
-            LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL;
+            LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << std::hex << hres << LL_ENDL;
             return 1;                 // Program has failed.
         }
 
@@ -147,7 +147,7 @@ S32 LLMachineID::init()
         
         if (FAILED(hres))
         {
-            LL_WARNS("AppInit") << "Could not connect. Error code = 0x"  << hex << hres << LL_ENDL;
+            LL_WARNS("AppInit") << "Could not connect. Error code = 0x"  << std::hex << hres << LL_ENDL;
             pLoc->Release();     
             return 1;                // Program has failed.
         }
@@ -171,7 +171,7 @@ S32 LLMachineID::init()
 
         if (FAILED(hres))
         {
-            LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x"   << hex << hres << LL_ENDL;
+            LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x"   << std::hex << hres << LL_ENDL;
             pSvc->Release();
             pLoc->Release();     
             return 1;               // Program has failed.
@@ -191,7 +191,7 @@ S32 LLMachineID::init()
         
         if (FAILED(hres))
         {
-            LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x"  << hex << hres << LL_ENDL;
+            LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x"  << std::hex << hres << LL_ENDL;
             pSvc->Release();
             pLoc->Release();
             return 1;               // Program has failed.
@@ -219,7 +219,7 @@ S32 LLMachineID::init()
             hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0);
             if (FAILED(hr))
             {
-                LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL;
+                LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << std::hex << hres << LL_ENDL;
                 pclsObj->Release();
                 pclsObj = NULL;
                 continue;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index e0bd2c8cedef6c038df57834c01df9b0eaffd817..dc927f8c9a41c3fbc6d7a56e415a5a2ec29b7a90 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4664,7 +4664,7 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
 
 // Check if there is enough free space to save snapshot
 #ifdef LL_WINDOWS
-	boost::filesystem::path b_path(utf8str_to_utf16str(lastSnapshotDir));
+	boost::filesystem::path b_path(ll_convert_string_to_wide(lastSnapshotDir));
 #else
 	boost::filesystem::path b_path(lastSnapshotDir);
 #endif