mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-02-26 08:22:31 +00:00
PCH #include scanner: force string encoding to be UTF-8
If the locale is set to non-UTF-8 when (d)rake is invoked then Ruby will set the encoding of all strings read from files to US-ASCII. As several source files do use non-ASCII characters this results in warnings from Ruby about "invalid byte sequence in US-ASCII". As all of my source code files are encoded in UTF-8 we can simply enforce this. This happens when building the RPMs which sets the locale to C.
This commit is contained in:
parent
c7478ea06b
commit
c7e004efa1
@ -383,6 +383,7 @@ PCH status: <%= c?(:USE_PRECOMPILED_HEADERS) ? "enabled" : "disabled" %>
|
||||
input = indirect ? indirect : user
|
||||
File.open(input) do |f|
|
||||
f.each_line do |line|
|
||||
line.force_encoding("UTF-8")
|
||||
next if !@scan_include_re.match(line)
|
||||
@scan_candidates.each do |pair|
|
||||
(dir,header) = *pair
|
||||
|
Loading…
Reference in New Issue
Block a user