Skip to content

Instantly share code, notes, and snippets.

@capflam
Created October 24, 2016 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capflam/5491516faa7024435d8200e068f505d2 to your computer and use it in GitHub Desktop.
Save capflam/5491516faa7024435d8200e068f505d2 to your computer and use it in GitHub Desktop.
Yaws :: Read the config file using unicode encoding
diff --git a/src/yaws_config.erl b/src/yaws_config.erl
index a61d2a1..7f645a1 100644
--- a/src/yaws_config.erl
+++ b/src/yaws_config.erl
@@ -60,7 +60,7 @@ load(E = #env{conf = false}) ->
load(E) ->
{file, File} = E#env.conf,
error_logger:info_msg("Yaws: Using config file ~s~n", [File]),
- case file:open(File, [read]) of
+ case file:open(File, [read, {encoding, unicode}]) of
{ok, FD} ->
GC = make_default_gconf(E#env.debug, E#env.id),
GC1 = if E#env.traceoutput == undefined ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment