Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Clarified the name of the codepage.
Browse files Browse the repository at this point in the history
  • Loading branch information
shoo committed Jul 16, 2012
1 parent c4ef1d3 commit 4ba6a10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rt/dmain2.d
Expand Up @@ -124,8 +124,9 @@ extern (C) void* rt_loadLibrary(in char[] name)
{
if (name.length == 0) return null;
// Load a DLL at runtime
enum CP_UTF8 = 65001;
wchar_t* tempW;
auto tempWbufofslen = MultiByteToWideChar(65001, 0,
auto tempWbufofslen = MultiByteToWideChar(CP_UTF8, 0,
name.ptr, name.length, null, 0);
if (!tempWbufofslen) return null;
enum wcharsize = typeof(*tempW).sizeof;
Expand All @@ -138,7 +139,7 @@ extern (C) void* rt_loadLibrary(in char[] name)
tempW[0..4] = r"\\?\";
auto tempWofs = cast(typeof(tempW))((cast(ubyte*)tempW)+ofssize);

auto tempWofslen = MultiByteToWideChar(65001, 0,
auto tempWofslen = MultiByteToWideChar(CP_UTF8, 0,
name.ptr, name.length, tempWofs, tempWbufofslen);
if (tempWofslen == 0 && tempWbufofslen != tempWofslen) return null;

Expand Down

0 comments on commit 4ba6a10

Please sign in to comment.