diff --binary -urN AutoHotkey104805_source.orig/source/script.cpp AutoHotkey104805_source/source/script.cpp
--- AutoHotkey104805_source.orig/source/script.cpp	2009-09-25 14:58:30.000000000 +0900
+++ AutoHotkey104805_source/source/script.cpp	2009-09-27 18:42:00.442250000 +0900
@@ -256,7 +256,7 @@
 	// lowercase/uppercase letters:
 	ConvertFilespecToCorrectCase(buf); // This might change the length, e.g. due to expansion of 8.3 filename.
 	char *filename_marker;
-	if (   !(filename_marker = strrchr(buf, '\\'))   )
+	if (   !(filename_marker = mbsrchr(buf, '\\'))   )
 		filename_marker = buf;
 	else
 		++filename_marker;
@@ -344,7 +344,7 @@
 			return FAIL;  // It already displayed the error for us.
 		else
 		{
-			char *last_backslash = strrchr(buf, '\\');
+			char *last_backslash = mbsrchr(buf, '\\');
 			if (!last_backslash) // probably can't happen due to the nature of GetModuleFileName().
 				mOurEXEDir = "";
 			last_backslash[1] = '\0'; // i.e. keep the trailing backslash for convenience.
@@ -6774,7 +6774,7 @@
 		// DETERMINE PATH TO "STANDARD" LIBRARY:
 		this_lib = sLib + 1; // For convenience and maintainability.
 		GetModuleFileName(NULL, this_lib->path, MAX_PATH); // The full path to the currently-running AutoHotkey.exe.
-		char_after_last_backslash = 1 + strrchr(this_lib->path, '\\'); // Should always be found, so failure isn't checked.
+		char_after_last_backslash = 1 + mbsrchr(this_lib->path, '\\'); // Should always be found, so failure isn't checked.
 		this_lib->length = (DWORD)(char_after_last_backslash - this_lib->path); // The length up to and including the last backslash.
 		if (this_lib->length < MAX_PATH-FUNC_STD_LIB_LENGTH)
 		{
@@ -11189,7 +11189,7 @@
 	char file_path[MAX_PATH], naked_filename_or_pattern[MAX_PATH]; // Giving +3 extra for "*.*" seems fairly pointless because any files that actually need that extra room would fail to be retrieved by FindFirst/Next due to their inability to support paths much over 256.
 	size_t file_path_length;
 	strlcpy(file_path, aFilePattern, sizeof(file_path));
-	char *last_backslash = strrchr(file_path, '\\');
+	char *last_backslash = mbsrchr(file_path, '\\');
 	if (last_backslash)
 	{
 		strcpy(naked_filename_or_pattern, last_backslash + 1); // Naked filename.  No danger of overflow due size of src vs. dest.
diff --binary -urN AutoHotkey104805_source.orig/source/script2.cpp AutoHotkey104805_source/source/script2.cpp
--- AutoHotkey104805_source.orig/source/script2.cpp	2009-09-25 14:43:48.000000000 +0900
+++ AutoHotkey104805_source/source/script2.cpp	2009-09-27 18:43:12.926625000 +0900
@@ -6855,7 +6855,7 @@
 	{
 		if (   !(drive_end = strchr(colon_double_slash + 3, '/'))   )
 		{
-			if (   !(drive_end = strchr(colon_double_slash + 3, '\\'))   ) // Try backslash so that things like file://C:\Folder\File.txt are supported.
+			if (   !(drive_end = mbschr(colon_double_slash + 3, '\\'))   ) // Try backslash so that things like file://C:\Folder\File.txt are supported.
 				drive_end = colon_double_slash + strlen(colon_double_slash); // Set it to the position of the zero terminator instead.
 				// And because there is no filename, leave name and name_delimiter set to their defaults.
 			//else there is a backslash, e.g. file://C:\Folder\File.txt, so treat that backslash as the end of the drive name.
@@ -6877,7 +6877,7 @@
 				// the directory, if desired.
 				name_delimiter = strrchr(aFileSpec, '/');
 				if (name_delimiter == colon_double_slash + 2) // To reach this point, it must have a backslash, something like file://c:\folder\file.txt
-					name_delimiter = strrchr(aFileSpec, '\\'); // Will always be found.
+					name_delimiter = mbsrchr(aFileSpec, '\\'); // Will always be found.
 				name = name_delimiter + 1; // This will be the empty string for something like http://domain.com/dir/
 			}
 			//else something like http://domain.com/, so leave name and name_delimiter set to their defaults.
@@ -6923,7 +6923,7 @@
 		// detected as UNCs.
 		if (drive[0] == '\\' && drive[1] == '\\') // Relies on short-circuit evaluation order.
 		{
-			if (   !(drive_end = strchr(drive + 2, '\\'))   )
+			if (   !(drive_end = mbschr(drive + 2, '\\'))   )
 				drive_end = drive + strlen(drive); // Set it to the position of the zero terminator instead.
 		}
 		else if (*(drive + 1) == ':') // It's an absolute path.
@@ -6942,7 +6942,7 @@
 			drive = ""; // This is necessary to allow Assign() to work correctly later below, since it interprets a length of zero as "use string's entire length".
 		}
 
-		if (   !(name_delimiter = strrchr(aFileSpec, '\\'))   ) // No backslash.
+		if (   !(name_delimiter = mbsrchr(aFileSpec, '\\'))   ) // No backslash.
 			if (   !(name_delimiter = strrchr(aFileSpec, ':'))   ) // No colon.
 				name_delimiter = NULL; // Indicate that there is no directory.
 
@@ -7038,9 +7038,9 @@
 	char *sort_item1 = *(char **)a1;
 	char *sort_item2 = *(char **)a2;
 	char *cp;
-	if (cp = strrchr(sort_item1, '\\'))  // Assign
+	if (cp = mbsrchr(sort_item1, '\\'))  // Assign
 		sort_item1 = cp + 1;
-	if (cp = strrchr(sort_item2, '\\'))  // Assign
+	if (cp = mbsrchr(sort_item2, '\\'))  // Assign
 		sort_item2 = cp + 1;
 	// v1.0.43.03: Added support the new locale-insensitive mode.
 	int result = strcmp2(sort_item1, sort_item2, g_SortCaseSensitive); // Resolve large macro only once for code size reduction.
@@ -7566,7 +7566,7 @@
 	char buf[MAX_PATH + 1];  // +1 to allow appending of backslash.
 	strlcpy(buf, aPath, sizeof(buf));
 	size_t length = strlen(buf);
-	if (buf[length - 1] != '\\') // Trailing backslash is present, which some of the API calls below don't like.
+	if (mbsrchr(buf, '\\') != buf + length - 1) // Trailing backslash is present, which some of the API calls below don't like.
 	{
 		if (length + 1 >= sizeof(buf)) // No room to fix it.
 			return OK; // Let ErrorLevel tell the story.
@@ -7624,7 +7624,7 @@
 	#define DRIVE_SET_PATH \
 		strlcpy(path, aValue, sizeof(path) - 1);\
 		path_length = strlen(path);\
-		if (path_length && path[path_length - 1] != '\\')\
+		if (path_length && mbsrchr(path, '\\') != path + path_length - 1)\
 			path[path_length++] = '\\';
 
 	switch(drive_cmd)
@@ -8343,7 +8343,7 @@
 			char *end_brace;
 			if (end_brace = strchr(working_dir, '}'))
 				is_directory = !end_brace[1] // First '}' is also the last char in string, so it's naked CLSID (so assume directory).
-					|| working_dir[strlen(working_dir) - 1] == '\\'; // Or path ends in backslash.
+					|| mbsrchr(working_dir, '\\') == working_dir + strlen(working_dir) - 1; // Or path ends in backslash.
 			else // Badly formatted clsid.
 				is_directory = true; // Arbitrary default due to rarity.
 		}
@@ -8358,7 +8358,7 @@
 			// folder/filename.  In either case, it seems best to assume it's a file because the user may want
 			// to provide a default SAVE filename, and it would be normal for such a file not to already exist.
 			char *last_backslash;
-			if (last_backslash = strrchr(working_dir, '\\'))
+			if (last_backslash = mbsrchr(working_dir, '\\'))
 			{
 				strlcpy(file_buf, last_backslash + 1, sizeof(file_buf)); // Set the default filename.
 				*last_backslash = '\0'; // Make the working directory just the file's path.
@@ -8530,7 +8530,7 @@
 				// v1.0.25.05: To make the result of selecting one file the same as selecting multiple files
 				// -- and thus easier to work with in a script -- convert the result into the multi-file
 				// format (folder as first item and naked filename as second):
-				if (cp = strrchr(file_buf, '\\'))
+				if (cp = mbsrchr(file_buf, '\\'))
 				{
 					*cp = '\n';
 					// If the folder is the root folder, add a backslash so that selecting a single
@@ -8598,7 +8598,7 @@
 
 	// If it has a backslash, make sure all its parent directories exist before we attempt
 	// to create this directory:
-	char *last_backslash = strrchr(aDirSpec, '\\');
+	char *last_backslash = mbsrchr(aDirSpec, '\\');
 	if (last_backslash > aDirSpec) // v1.0.48.04: Changed "last_backslash" to "last_backslash > aDirSpec" so that an aDirSpec with a leading \ (but no other backslashes), such as \dir, is supported.
 	{
 		char parent_dir[MAX_PATH];
@@ -9127,7 +9127,7 @@
 	// Remove the filename and/or wildcard part.   But leave the trailing backslash on it for
 	// consistency with below:
 	size_t file_path_length;
-	char *last_backslash = strrchr(file_path, '\\');
+	char *last_backslash = mbsrchr(file_path, '\\');
 	if (last_backslash)
 	{
 		*(last_backslash + 1) = '\0'; // i.e. retain the trailing backslash.
@@ -9276,7 +9276,7 @@
 	strcpy(file_path, aFilePattern);    // An earlier check has ensured these won't overflow.
 
 	size_t file_path_length; // The length of just the path portion of the filespec.
-	char *last_backslash = strrchr(file_path, '\\');
+	char *last_backslash = mbsrchr(file_path, '\\');
 	if (last_backslash)
 	{
 		// Remove the filename and/or wildcard part.   But leave the trailing backslash on it for
@@ -9293,7 +9293,7 @@
 	size_t space_remaining = sizeof(file_path) - file_path_length - 1; // Space left in file_path for the changing part.
 
 	// For use with aDoRecurse, get just the naked file name/pattern:
-	char *naked_filename_or_pattern = strrchr(file_pattern, '\\');
+	char *naked_filename_or_pattern = mbsrchr(file_pattern, '\\');
 	if (naked_filename_or_pattern)
 		++naked_filename_or_pattern;
 	else
@@ -9545,7 +9545,7 @@
 	strcpy(file_path, aFilePattern); // An earlier check has ensured this won't overflow.
 
 	size_t file_path_length; // The length of just the path portion of the filespec.
-	char *last_backslash = strrchr(file_path, '\\');
+	char *last_backslash = mbsrchr(file_path, '\\');
 	if (last_backslash)
 	{
 		// Remove the filename and/or wildcard part.   But leave the trailing backslash on it for
@@ -9562,7 +9562,7 @@
 	size_t space_remaining = sizeof(file_path) - file_path_length - 1; // Space left in file_path for the changing part.
 
 	// For use with aDoRecurse, get just the naked file name/pattern:
-	char *naked_filename_or_pattern = strrchr(file_pattern, '\\');
+	char *naked_filename_or_pattern = mbsrchr(file_pattern, '\\');
 	if (naked_filename_or_pattern)
 		++naked_filename_or_pattern;
 	else
@@ -10583,7 +10583,7 @@
 		if (length)
 		{
 			aBuf += length - 1;
-			if (*aBuf == '\\') // For some reason, it typically yields a trailing backslash, so omit it to improve friendliness/consistency.
+			if (mbsrchr(buf, '\\') == aBuf) // For some reason, it typically yields a trailing backslash, so omit it to improve friendliness/consistency.
 			{
 				*aBuf = '\0';
 				--length;
@@ -10880,7 +10880,7 @@
 	if (g->mLoopFile)
 	{
 		// The loop handler already prepended the script's directory in here for us:
-		if (naked_filename = strrchr(g->mLoopFile->cFileName, '\\'))
+		if (naked_filename = mbsrchr(g->mLoopFile->cFileName, '\\'))
 			++naked_filename;
 		else // No backslash, so just make it the entire file name.
 			naked_filename = g->mLoopFile->cFileName;
@@ -10938,7 +10938,7 @@
 		// But if the loop had a relative path in its FilePattern, there might be
 		// only a relative directory here, or no directory at all if the current
 		// file is in the origin/root dir of the search:
-		if (last_backslash = strrchr(g->mLoopFile->cFileName, '\\'))
+		if (last_backslash = mbsrchr(g->mLoopFile->cFileName, '\\'))
 		{
 			*last_backslash = '\0'; // Temporarily terminate.
 			file_dir = g->mLoopFile->cFileName;
@@ -12009,7 +12009,7 @@
 
 		// Make a modifiable copy of param1 so that the DLL name and function name can be parsed out easily, and so that "A" can be appended if necessary (e.g. MessageBoxA):
 		strlcpy(param1_buf, aParam[0]->symbol == SYM_VAR ? aParam[0]->var->Contents() : aParam[0]->marker, sizeof(param1_buf) - 1); // -1 to reserve space for the "A" suffix later below.
-		if (   !(function_name = strrchr(param1_buf, '\\'))   ) // No DLL name specified, so a search among standard defaults will be done.
+		if (   !(function_name = mbsrchr(param1_buf, '\\'))   ) // No DLL name specified, so a search among standard defaults will be done.
 		{
 			dll_name = NULL;
 			function_name = param1_buf;
diff --binary -urN AutoHotkey104805_source.orig/source/script_autoit.cpp AutoHotkey104805_source/source/script_autoit.cpp
--- AutoHotkey104805_source.orig/source/script_autoit.cpp	2009-09-13 17:13:08.000000000 +0900
+++ AutoHotkey104805_source/source/script_autoit.cpp	2009-09-27 18:42:00.848500000 +0900
@@ -1859,7 +1859,7 @@
 				return false;
 			szTemp = (char *)_alloca(length+1); // Faster, and also avoids need to delete it afterward.
 			strcpy(szTemp, szDirName);
-			psz_Loc = strrchr(szTemp, '\\');	/* find last \ */
+			psz_Loc = mbsrchr(szTemp, '\\');	/* find last \ */
 			if (psz_Loc == NULL)				// not found
 				return false;
 			else 
diff --binary -urN AutoHotkey104805_source.orig/source/util.cpp AutoHotkey104805_source/source/util.cpp
--- AutoHotkey104805_source.orig/source/util.cpp	2009-09-20 10:20:08.000000000 +0900
+++ AutoHotkey104805_source/source/util.cpp	2009-09-27 18:42:01.036000000 +0900
@@ -1336,11 +1336,11 @@
 		// lpFileName of the form "\\server\service\*" but you cannot use an lpFileName that
 		// points to the share itself, such as "\\server\service".
 		dir_start = aFullFileSpec + 2;
-		char *end_of_server_name = strchr(dir_start, '\\');
+		char *end_of_server_name = mbschr(dir_start, '\\');
 		if (end_of_server_name)
 		{
 			dir_start = end_of_server_name + 1;
-			char *end_of_share_name = strchr(dir_start, '\\');
+			char *end_of_share_name = mbschr(dir_start, '\\');
 			if (end_of_share_name)
 				dir_start = end_of_share_name + 1;
 		}
@@ -1349,7 +1349,7 @@
 	strlcpy(built_filespec, aFullFileSpec, dir_start - aFullFileSpec + 1);
 	WIN32_FIND_DATA found_file;
 	HANDLE file_search;
-	for (dir_end = dir_start; dir_end = strchr(dir_end, '\\'); ++dir_end)
+	for (dir_end = dir_start; dir_end = mbschr(dir_end, '\\'); ++dir_end)
 	{
 		*dir_end = '\0';  // Temporarily terminate.
 		file_search = FindFirstFile(aFullFileSpec, &found_file);
diff --binary -urN AutoHotkey104805_source.orig/source/util.h AutoHotkey104805_source/source/util.h
--- AutoHotkey104805_source.orig/source/util.h	2009-02-15 16:52:36.000000000 +0900
+++ AutoHotkey104805_source/source/util.h	2009-09-27 18:42:01.114125000 +0900
@@ -18,6 +18,7 @@
 #define util_h
 
 #include "stdafx.h" // pre-compiled headers
+#include <mbstring.h>
 #include "defines.h"
 EXTERN_G;  // For ITOA() and related functions' use of g->FormatIntAsHex
 
@@ -449,7 +450,15 @@
 //	return (char *)memmove(aDst_end, aSrc, strlen(aSrc) + 1);  // Add 1 to include aSrc's terminator.
 //}
 
+inline char* mbschr(char *str, unsigned int c)
+{
+	return (char*)_mbschr((unsigned char*)str, c);
+}
 
+inline char* mbsrchr(char *str, unsigned int c)
+{
+	return (char*)_mbsrchr((unsigned char*)str, c);
+}
 
 // v1.0.43.03: The following macros support the new "StringCaseSense Locale" setting.  This setting performs
 // 1 to 10 times slower for most things, but has the benefit of seeing characters like ä and Ä as identical
