Skip to content

Commit

Permalink
Merge branch 'master' into build_1.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Oelckers committed May 8, 2014
2 parents c0dd09c + a7f8f7c commit eb2e417
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/resourcefiles/file_7z.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ bool F7ZFile::Open(bool quiet)
Lumps = new F7ZLump[NumLumps];

F7ZLump *lump_p = Lumps;
TArray<UInt16> nameUTF16;
TArray<char> nameASCII;
for (DWORD i = 0; i < NumLumps; ++i)
{
CSzFileItem *file = &Archive->DB.db.Files[i];
Expand All @@ -283,20 +285,16 @@ bool F7ZFile::Open(bool quiet)
continue;
}

// Convert UTF-16 filename to plain ASCII

UInt16* const nameUTF16 = static_cast<UInt16*>(alloca(sizeof(UInt16) * nameLength));
SzArEx_GetFileNameUtf16(&Archive->DB, i, nameUTF16);

char* const nameASCII = static_cast<char*>(alloca(nameLength));

nameUTF16.Resize(nameLength);
nameASCII.Resize(nameLength);
SzArEx_GetFileNameUtf16(&Archive->DB, i, &nameUTF16[0]);
for (size_t c = 0; c < nameLength; ++c)
{
nameASCII[c] = static_cast<char>(nameUTF16[c]);
}
FixPathSeperator(&nameASCII[0]);

FString name = nameASCII;
FixPathSeperator(name);
FString name = &nameASCII[0];
name.ToLower();

lump_p->LumpNameSetup(name);
Expand Down

0 comments on commit eb2e417

Please sign in to comment.