Current section

5 Versions

Jump to

Compare versions

3 files changed
+6 additions
-5 deletions
  @@ -12,4 +12,4 @@
12 12 {<<"GitHub">>,<<"https://github.com/emacsist/gbk_to_utf8">>}]}.
13 13 {<<"name">>,<<"gbk_to_utf8">>}.
14 14 {<<"requirements">>,[]}.
15 - {<<"version">>,<<"0.1.3">>}.
15 + {<<"version">>,<<"0.1.4">>}.
  @@ -12,14 +12,14 @@ defmodule GbkToUtf8 do
12 12 def start do
13 13 String.split(GbkToUtf8Map.cp936string(), "\r\n", trim: true)
14 14 |> Enum.filter(fn l -> !String.starts_with?(l, "#") end)
15 - |> IO.inspect()
15 + #|> IO.inspect()
16 16 |> Enum.map(fn l ->
17 17 [gbk, utf8, _] = String.split(l, "\t")
18 - gbk = String.replace(gbk, "0x", "")
18 + gbk = String.replace(gbk, ["0x0", "0x"], "")
19 19 utf8 = String.replace(utf8, "0x", "")
20 20 {gbk, utf8}
21 21 end)
22 - |> IO.inspect()
22 + #|> IO.inspect()
23 23 |> Enum.each(fn {gbk, utf8} ->
24 24 :persistent_term.put({__MODULE__, gbk}, utf8)
25 25 end)
  @@ -72,4 +72,5 @@ defmodule GbkToUtf8 do
72 72 <<c::16>> = b1
73 73 :persistent_term.get({__MODULE__, Integer.to_string(c, 16)}, "0")
74 74 end
75 +
75 76 end
  @@ -4,7 +4,7 @@ defmodule GbkToUtf8.MixProject do
4 4 def project do
5 5 [
6 6 app: :gbk_to_utf8,
7 - version: "0.1.3",
7 + version: "0.1.4",
8 8 elixir: "~> 1.12",
9 9 start_permanent: Mix.env() == :prod,
10 10 description: description(),