adb/base: fix adb push of Unicode filenames on Win32
ae5a6c06 made adb push use android::base::ReadFileToString() for small files, but that API did not support UTF-8 filenames on Windows, until this fix which does the following: - Add android::base::{WideToUTF8,UTF8ToWide}() which are only available on Windows. The signatures are based on Chromium's APIs of the same name. - Add the namespace android::base::utf8 which has versions of APIs that take UTF-8 strings. To use this, make sure your code is in a namespace and then do "using namespace android::base::utf8;". On Windows, this will make calls to open() call android::base::utf8::open(), and on other platforms, it will just call the regular ::open(). - Make ReadFileToString() and WriteStringToFile() use utf8::open() and utf8::unlink(). - Adapt unittests from Chromium. - fastboot needs to link with libcutils because it links with libbase which depends on libcutils for gettid() for logging. Change-Id: I1aeac40ff358331d7a1ff457ce894bfb17863904 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Loading
Please register or sign in to comment