Index: trunk/ab5.0/jenga/src/common/String.cpp
===================================================================
--- trunk/ab5.0/jenga/src/common/String.cpp	(revision 749)
+++ trunk/ab5.0/jenga/src/common/String.cpp	(revision 763)
@@ -1,17 +1,11 @@
 #include "stdafx.h"
+#include <algorithm>
 
 bool Jenga::Common::IsExistString( const Jenga::Common::Strings &strings, const std::string &findStr )
 {
-	BOOST_FOREACH( const std::string &str, strings )
-	{
-		if( str == findStr )
-		{
-			return true;
-		}
-	}
-	return false;
+	return std::find( strings.begin(), strings.end(), findStr ) != strings.end();
 }
 
-std::string& Jenga::Common::StringReplace( std::string& str, const std::string sb, const std::string sa )
+std::string& Jenga::Common::StringReplace( std::string& str, const std::string &sb, const std::string &sa )
 {
 	std::string::size_type n, nb = 0;
@@ -38,17 +32,17 @@
 		CP_THREAD_ACP,
 		0,
-		wstr.c_str(), -1,
+		wstr.data(), static_cast<int>(wstr.size()),
 		NULL, NULL,
 		NULL, NULL );
 
-	char *pstr = (char *)calloc( needSize + 1, 1 );
+	char *pstr = (char *)calloc( needSize, 1 );
 	WideCharToMultiByte(
 		CP_THREAD_ACP,
 		0,
-		wstr.c_str(), -1,
+		wstr.data(), static_cast<int>(wstr.size()),
 		pstr, needSize,
 		NULL, NULL );
 
-	std::string result = pstr;
+	std::string result(pstr, needSize);
 
 	free( pstr );
@@ -62,16 +56,16 @@
 		CP_ACP,
 		0,
-		str.c_str(), static_cast<int>(str.size()) + 1,
-		NULL, 0 ) * 4;
+		str.data(), static_cast<int>(str.size()),
+		NULL, 0 );
 
-	LPWSTR pwstr = (LPWSTR)calloc( size, 1 );
+	LPWSTR pwstr = (LPWSTR)calloc( size, sizeof (wchar_t) );
 
 	MultiByteToWideChar(
 		CP_ACP,
 		0,
-		str.c_str(), static_cast<int>(str.size()) + 1,
-		pwstr, static_cast<int>(str.size()) + 1 );
+		str.data(), static_cast<int>(str.size()),
+		pwstr, size );
 
-	std::wstring wstr( pwstr, str.size() );
+	std::wstring wstr( pwstr, size );
 
 	free( pwstr );
