Your current best option is ux_string:to_lower/1 from the ux library which will properly lower all characters, not just A-Z.On 10/21/2012 09:14 PM, Roberto Ostinelli wrote:
Dear list,
I've a binary string which includes accented characters and unicode,
that i need to downcase.
Is my real best option here to convert everything to list and downcase that?
Should be at https://github.com/erlang-unicode/ux
--
Loďc Hoguin
On 10/21/2012 09:25 PM, Roberto Ostinelli wrote:
> Thank you Loïc,
>
> did you happen to benchmark it? Would that be better/faster than a
> simple list_to_binary(string:to_lower(binary_to_list(Bin)))?
>
> On Sun, Oct 21, 2012 at 12:18 PM, Loïc Hoguin <es...@ninenines.eu
> <mailto:es...@ninenines.eu>> wrote:
>
> On 10/21/2012 09:14 PM, Roberto Ostinelli wrote:
>
> Dear list,
>
> I've a binary string which includes accented characters and unicode,
> that i need to downcase.
>
> Is my real best option here to convert everything to list and
> downcase that?
>
>
> Your current best option is ux_string:to_lower/1 from the ux library
> which will properly lower all characters, not just A-Z.
>
> Should be at https://github.com/erlang-__unicode/ux
> <https://github.com/erlang-unicode/ux>
>
> --
> Loďc Hoguin
> Erlang Cowboy
> Nine Nines
> http://ninenines.eu
>
>
--
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu
On 10/21/2012 09:39 PM, Roberto Ostinelli wrote:
> For the records, this just works..
>
> start() ->
> Unicode = list_to_binary("∞-HOpe@☺.EXAMple.com/My❤"),
> Result = list_to_binary(string:to_lower(binary_to_list(Unicode))),
> "∞-hope@☺.example.com/my <http://example.com/my>❤" = binary_to_list(Result).
>
> any downsides I'm not seeing?
>
> On Sun, Oct 21, 2012 at 12:25 PM, Roberto Ostinelli <rob...@widetag.com
> <mailto:rob...@widetag.com>> wrote:
>
> Thank you Loïc,
>
> did you happen to benchmark it? Would that be better/faster than a
> simple list_to_binary(string:to_lower(binary_to_list(Bin)))?
>
>
> On Sun, Oct 21, 2012 at 12:18 PM, Loïc Hoguin <es...@ninenines.eu
> <mailto:es...@ninenines.eu>> wrote:
>
> On 10/21/2012 09:14 PM, Roberto Ostinelli wrote:
>
> Dear list,
>
> I've a binary string which includes accented characters and
> unicode,
> that i need to downcase.
>
> Is my real best option here to convert everything to list
> and downcase that?
>
>
> Your current best option is ux_string:to_lower/1 from the ux
> library which will properly lower all characters, not just A-Z.
>
> Should be at https://github.com/erlang-__unicode/ux
> <https://github.com/erlang-unicode/ux>
>
> --
> Loďc Hoguin
> Erlang Cowboy
> Nine Nines
> http://ninenines.eu
>
>
>
--
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu
On 10/21/2012 09:51 PM, Roberto Ostinelli wrote:
> Oh I see.
>
> So if I want to downcase this string: "∞-HOpe@☺.ÉXAMple.com/My❤" I will
> need ux?
>
> r.
>
> On Sun, Oct 21, 2012 at 12:46 PM, Loïc Hoguin <es...@ninenines.eu
> <mailto:es...@ninenines.eu>> wrote:
>
> This only works for letters found in latin1, not for all the
> uppercases found in unicode. If that's good enough for you then you
> don't need ux. :)
>
>
> On 10/21/2012 09:39 PM, Roberto Ostinelli wrote:
>
> For the records, this just works..
>
> start() ->
> Unicode = list_to_binary("∞-HOpe@☺.__EXAMple.com/My❤"),
> Result =
> list_to_binary(string:to___lower(binary_to_list(Unicode))__),
> "∞-hope@☺.example.com/my <http://example.com/my>
> <http://example.com/my>❤" = binary_to_list(Result).
>
>
> any downsides I'm not seeing?
>
> On Sun, Oct 21, 2012 at 12:25 PM, Roberto Ostinelli
> <rob...@widetag.com <mailto:rob...@widetag.com>
> <mailto:rob...@widetag.com <mailto:rob...@widetag.com>>> wrote:
>
> Thank you Loïc,
>
> did you happen to benchmark it? Would that be better/faster
> than a
> simple list_to_binary(string:to___lower(binary_to_list(Bin)))?
>
>
> On Sun, Oct 21, 2012 at 12:18 PM, Loïc Hoguin
> <es...@ninenines.eu <mailto:es...@ninenines.eu>
> <mailto:es...@ninenines.eu <mailto:es...@ninenines.eu>>> wrote:
>
> On 10/21/2012 09:14 PM, Roberto Ostinelli wrote:
>
> Dear list,
>
> I've a binary string which includes accented
> characters and
> unicode,
> that i need to downcase.
>
> Is my real best option here to convert everything
> to list
> and downcase that?
>
>
> Your current best option is ux_string:to_lower/1 from
> the ux
> library which will properly lower all characters, not
> just A-Z.
>
> Should be at https://github.com/erlang-____unicode/ux
> <https://github.com/erlang-__unicode/ux>
>
> <https://github.com/erlang-__unicode/ux
> <https://github.com/erlang-unicode/ux>>
>
> --
> Loďc Hoguin
> Erlang Cowboy
> Nine Nines
> http://ninenines.eu
>
>
>
>
>
> --
> Loïc Hoguin
>
> Erlang Cowboy
> Nine Nines
> http://ninenines.eu
>
>
--
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu