[WIN] Implement WebCore::fileSystemRepresentation() for !USE(CF)
https://bugs.webkit.org/show_bug.cgi?id=104456

Reviewed by Brent Fulgham.

Convert the UTF-16 path to the system default Windows ANSI code page (usually Windows Latin1).

* platform/win/FileSystemWin.cpp:
(WebCore::fileSystemRepresentation):


git-svn-id: svn://svn.chromium.org/blink/trunk@137547 bbb929c8-8fbe-4397-9dbb-9b2b20218538
String pathByAppendingComponent(const String& path, const String& component)
{
    Vector<UChar> buffer(MAX_PATH);

    if (path.length() + 1 > buffer.size())
        return String();

    memcpy(buffer.data(), path.characters(), path.length() * sizeof(UChar));
    buffer[path.length()] = '\0';

    String componentCopy = component;
    if (!PathAppendW(buffer.data(), componentCopy.charactersWithNullTermination()))
        return String();

    buffer.resize(wcslen(buffer.data()));

    return String::adopt(buffer);
}

String pathByAppendingComponent(const String& path, const String& component)
{
    Vector<UChar> buffer(MAX_PATH);

    if (path.length() + 1 > buffer.size())
        return String();

    memcpy(buffer.data(), path.characters(), path.length() * sizeof(UChar));
    buffer[path.length()] = '\0';

    String componentCopy = component;
    if (!PathAppendW(buffer.data(), componentCopy.charactersWithNullTermination()))
        return String();

    buffer.resize(wcslen(buffer.data()));

    return String::adopt(buffer);
}
