diff options
author | w1gz <w1gz@noreply.com> | 2017-02-21 23:31:56 +0100 |
---|---|---|
committer | w1gz <w1gz@noreply.com> | 2017-02-22 23:33:06 +0100 |
commit | 7094b6a7df22f01121b985e773fa341aea2295f0 (patch) | |
tree | fe91d2a6b40bb2c92264b5cb88f567360831cd6b /lib/exirc/utils.ex | |
parent | Update ex_doc (diff) |
Fix unicode bug when parsing message arguments
Diffstat (limited to '')
-rw-r--r-- | lib/exirc/utils.ex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/exirc/utils.ex b/lib/exirc/utils.ex index d3f903c..0ef392e 100644 --- a/lib/exirc/utils.ex +++ b/lib/exirc/utils.ex @@ -54,7 +54,7 @@ defmodule ExIrc.Utils do |> Enum.map(&List.to_string/1) case args do args when args != [] -> - %{msg | + %{msg | cmd: to_string(ctcp_cmd), args: [to_string(target), args |> Enum.join(" ")], ctcp: true @@ -72,10 +72,10 @@ defmodule ExIrc.Utils do # Parse command args from message defp get_args([], msg) do args = msg.args - |> Enum.reverse - |> Enum.filter(fn arg -> arg != [] end) - |> Enum.map(&trim_crlf/1) - |> Enum.map(&List.to_string/1) + |> Enum.reverse + |> Enum.filter(fn arg -> arg != [] end) + |> Enum.map(&trim_crlf/1) + |> Enum.map(&(:unicode.characters_to_binary(&1, :unicode, :latin1))) post_process(%{msg | args: args}) end |