Skip to content

Commit

Permalink
Use :erlang.iolist_to_binary/1 when decoding JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Sep 5, 2024
1 parent a5cd8de commit dfcada3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

**Cldr Utils from version 2.27.0 requires Elixir 1.12 or later**

## Cldr Utils version 2.28.2

This is the changelog for Cldr Utils v2.28.2 released on September 6th, 2024. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_utils/tags)

### Bug Fixes

* Use `:erlang.iolist_to_binary/1` instead of `List.to_string/1` since the later won't handle some unicode correctlt.

## Cldr Utils version 2.28.1

This is the changelog for Cldr Utils v2.28.1 released on August 14th, 2024. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_utils/tags)
Expand Down
4 changes: 2 additions & 2 deletions lib/cldr/utils/json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if Code.ensure_loaded?(:json) do

def decode!(charlist) when is_list(charlist) do
charlist
|> List.to_string()
|> :erlang.iolist_to_binary()
|> decode!()
end

Expand All @@ -57,7 +57,7 @@ if Code.ensure_loaded?(:json) do

def decode!(charlist, options) when is_list(charlist) do
charlist
|> List.to_string()
|> :erlang.iolist_to_binary()
|> decode!(options)
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Cldr.Utils.MixProject do
use Mix.Project

@version "2.28.1"
@version "2.28.2"
@source_url "https://github.com/elixir-cldr/cldr_utils"

def project do
Expand Down

0 comments on commit dfcada3

Please sign in to comment.