[PATCH] Add writeFileWithSystemEncoding to LibLLVMSupport

Rafael Auler rafaelauler at gmail.com
Wed Aug 13 20:07:35 PDT 2014


Hi rafael,

This patch adds to LLVMSupport the capability of writing files with international characters encoded in the current system encoding. This is relevant for Windows, where we can either use UTF16 or the current code page (the legacy Windows international characters). On UNIX, the file is always saved in UTF8. 

This patch also fixes a bug in the Unix version of argumentsFitWithinSystemLimits(). Both functions will be used in a patch for clang to thoroughly support response files creation when calling other tools, addressing PR15171. On Windows, to correctly support internationalization, we need the ability to write response files both in UTF16 or the current code page, depending on the tool we will call. GCC for mingw, for instance, requires files to be encoded in the current code page. MSVC tools requires files to be encoded in UTF16.

http://reviews.llvm.org/D4896

Files:
  include/llvm/Support/Program.h
  lib/Support/Unix/Program.inc
  lib/Support/Windows/Path.inc
  lib/Support/Windows/Program.inc
  lib/Support/Windows/WindowsSupport.h
  unittests/Support/ProgramTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4896.12481.patch
Type: text/x-patch
Size: 12327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140814/73de82c4/attachment.bin>


More information about the llvm-commits mailing list