Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/DefaultFileSystem.cpp

Issue 10459038: Clean up and fix Utils::ToUTF8String() and Utils::ToUTF16String() (Closed)
Patch Set: Created May 14, 2013, 1:54 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/DefaultWebRequestWinInet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/DefaultFileSystem.cpp
===================================================================
--- a/src/DefaultFileSystem.cpp
+++ b/src/DefaultFileSystem.cpp
@@ -46,17 +46,17 @@ namespace
{
}
};
#ifdef WIN32
// Paths need to be converted from UTF-8 to UTF-16 on Windows.
std::wstring NormalizePath(const std::string& path)
{
- return Utils::ToUTF16String(path, path.length());
+ return Utils::ToUTF16String(path);
}
#define rename _wrename
#define remove _wremove
#else
// POSIX systems: assume that file system encoding is UTF-8 and just use the
// file paths as they are.
#define NormalizePath(path) (path)
@@ -155,17 +155,17 @@ std::string DefaultFileSystem::Resolve(c
{
if (basePath == "")
{
return path;
}
else
{
#ifdef _WIN32
- if (PathIsRelative(Utils::ToUTF16String(path, path.length()).c_str()))
+ if (PathIsRelative(NormalizePath(path).c_str()))
#else
if (path.length() && *path.begin() != PATH_SEPARATOR)
#endif
{
return basePath + PATH_SEPARATOR + path;
}
else
{
« no previous file with comments | « no previous file | src/DefaultWebRequestWinInet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld