Skip to content

Commit 6460c64

Browse files
authored
Fix how UTF8 env is stored in .app file (#14890)
1 parent 31905ca commit 6460c64

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/mix/lib/mix/tasks/compile.app.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ defmodule Mix.Tasks.Compile.App do
192192
:application.load({:application, app, properties})
193193

194194
Mix.Project.ensure_structure()
195-
File.write!(target, [contents, ?.])
195+
File.write!(target, IO.chardata_to_string([contents, ?.]))
196196
File.touch!(target, new_mtime)
197197

198198
# If we just created the .app file, it will have touched

lib/mix/test/mix/tasks/compile.app_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ defmodule Mix.Tasks.Compile.AppTest do
110110
test "uses custom application settings" do
111111
in_fixture("no_mixfile", fn ->
112112
Mix.Project.push(CustomProject)
113-
env = [foo: [:one, "two", 3, 4], bar: [{} | %{foo: :bar}]]
113+
env = [foo: [:one, "two", 3, 4, "฿"], bar: [{} | %{foo: :bar}]]
114114

115115
Process.put(:application,
116116
maxT: :infinity,
@@ -132,7 +132,7 @@ defmodule Mix.Tasks.Compile.AppTest do
132132
assert properties[:applications] ==
133133
[:kernel, :stdlib, :elixir, :logger, :ex_unit, :example_app, :mix]
134134

135-
assert properties[:env] == [foo: [:one, "two", 3, 4], bar: [{} | %{foo: :bar}]]
135+
assert properties[:env] == [foo: [:one, "two", 3, 4, "฿"], bar: [{} | %{foo: :bar}]]
136136

137137
refute Keyword.has_key?(properties, :extra_applications)
138138
end)

0 commit comments

Comments
 (0)