diff options
author | Paul Schoenfelder <paulschoenfelder@gmail.com> | 2017-02-22 16:57:00 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 16:57:00 -0600 |
commit | cbb7926b136dab17fb5bae8a51ad1566eaedb180 (patch) | |
tree | fe91d2a6b40bb2c92264b5cb88f567360831cd6b /lib/exirc/utils.ex | |
parent | Update ex_doc (diff) | |
parent | Fix unicode bug when parsing message arguments (diff) |
Merge pull request #60 from w1gz/unicode-bug-in-get-args
Fix unicode bug when parsing message arguments
Diffstat (limited to 'lib/exirc/utils.ex')
-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 |