Message from discussion
Downcase Accented characters
Received: by 10.204.145.140 with SMTP id d12mr1035914bkv.6.1350848731869;
Sun, 21 Oct 2012 12:45:31 -0700 (PDT)
X-BeenThere: erlang-programming@googlegroups.com
Received: by 10.204.131.72 with SMTP id w8ls3292800bks.3.gmail; Sun, 21 Oct
2012 12:45:31 -0700 (PDT)
Received: by 10.204.149.65 with SMTP id s1mr1035450bkv.3.1350848731611;
Sun, 21 Oct 2012 12:45:31 -0700 (PDT)
Received: by 10.204.149.65 with SMTP id s1mr1035449bkv.3.1350848731580;
Sun, 21 Oct 2012 12:45:31 -0700 (PDT)
Return-Path: <erlang-questions-boun...@erlang.org>
Received: from hades.cslab.ericsson.net (hades.cslab.ericsson.net. [192.121.151.104])
by gmr-mx.google.com with ESMTP id 27si831389bks.3.2012.10.21.12.45.31;
Sun, 21 Oct 2012 12:45:31 -0700 (PDT)
Received-SPF: pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) client-ip=192.121.151.104;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) smtp.mail=erlang-questions-boun...@erlang.org
Received: from hades.cslab.ericsson.net (hades [192.121.151.104])
by hades.cslab.ericsson.net (Postfix) with ESMTP id 0796C5C178;
Sun, 21 Oct 2012 21:45:24 +0200 (CEST)
X-Original-To: erlang-questi...@erlang.org
Delivered-To: erlang-questi...@erlang.org
Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
[209.85.217.181])
by hades.cslab.ericsson.net (Postfix) with ESMTP id 0A82E5C002
for <erlang-questi...@erlang.org>; Sun, 21 Oct 2012 21:45:22 +0200 (CEST)
Received: by mail-lb0-f181.google.com with SMTP id gg6so1213391lbb.40
for <erlang-questi...@erlang.org>; Sun, 21 Oct 2012 12:45:21 -0700 (PDT)
d=google.com; s=20120113;
h=mime-version:sender:in-reply-to:references:date
:x-google-sender-auth:message-id:subject:from:to:cc:content-type
:x-gm-message-state;
bh=zZkXstdh/7xBO+lopBdsvSCpiQ8lMZTZeHujAot4eTY=;
b=bvuRemllcieZDtlPIhnd1S5oUxIj2L4GgEiwnLLjKF5ac9rKtVOd7lFbmbkNJ5sHPy
mVgwEtsjjsa0Uk9jZxYbALMrO2TJjSb8Yvezug9EHAzVQO/hMxgYJO9hcC15GnTgvYKI
4i78NXIt5x1QMQ7oKo9OpQMP+uOe6F/4r58WQIpo9raNGMFJBKv2TNPFWmivJ49FbIBc
7SVhhtb+DR5Rpp4TBPdzMmYNIlB+D7OsBeFBTe7zJG5DflfuavYEzrPdDo/YTB1z6swq
ExqMF3dBL8p1aAAk5SELvm8MWnUJ/SJuTWN9dszzHllSS4p3KvRxxra40DriAU1nk2+S
iYRQ==
MIME-Version: 1.0
Received: by 10.112.103.7 with SMTP id fs7mr2872231lbb.25.1350848721763; Sun,
21 Oct 2012 12:45:21 -0700 (PDT)
Received: by 10.152.24.226 with HTTP; Sun, 21 Oct 2012 12:45:21 -0700 (PDT)
In-Reply-To: <CAM5fRypfpEeByAvthCST3FWO++jSpdJg4=0Ec2CdMEmkGJv...@mail.gmail.com>
References: <CAM5fRyoEP0EWiUT94SF8K-5u9gDjFznB5nNEJieq2XLze19...@mail.gmail.com>
<50844A9E.5040...@ninenines.eu>
<CAM5fRypAMhwJF5RXfhLQEnd3g3guBOvhExN8vwHQphsj8DH...@mail.gmail.com>
<CAM5fRypfpEeByAvthCST3FWO++jSpdJg4=0Ec2CdMEmkGJv...@mail.gmail.com>
Date: Sun, 21 Oct 2012 12:45:21 -0700
Message-ID: <CAM5fRyqN2s9UGHH=gDJeXs8B-y3m-q95h=pJvRr5WiCQiZm...@mail.gmail.com>
From: Roberto Ostinelli <robe...@widetag.com>
To: =?ISO-8859-1?Q?Lo=EFc_Hoguin?= <es...@ninenines.eu>
X-Gm-Message-State: ALoCoQn43cK8t/IZ3Gi7n3wccYTdzTXfKIORjuh56/n/pgmMNViVdKrm+xFZRFpI0Mt/di4U0b8B
Cc: Erlang <erlang-questi...@erlang.org>
Subject: Re: [erlang-questions] Downcase Accented characters
X-BeenThere: erlang-questi...@erlang.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: General Erlang/OTP discussions <erlang-questions.erlang.org>
List-Unsubscribe: <http://erlang.org/mailman/options/erlang-questions>,
<mailto:erlang-questions-requ...@erlang.org?subject=unsubscribe>
List-Archive: <http://erlang.org/pipermail/erlang-questions>
List-Post: <mailto:erlang-questi...@erlang.org>
List-Help: <mailto:erlang-questions-requ...@erlang.org?subject=help>
List-Subscribe: <http://erlang.org/mailman/listinfo/erlang-questions>,
<mailto:erlang-questions-requ...@erlang.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8224250682843146801=="
Errors-To: erlang-questions-boun...@erlang.org
Sender: erlang-questions-boun...@erlang.org
--===============8224250682843146801==
Content-Type: multipart/alternative; boundary=f46d0401fea534beec04cc96fa22
--f46d0401fea534beec04cc96fa22
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
BTW,
ux dependencies are unsatisfied:
=3D=3D> ux (get-deps)
Pulling abnfc from {git,"git://github.com/nygge/abnfc.git","master"}
Cloning into 'abnfc'...
Pulling metamodule from {git,"git://github.com/freeakk/metamodule.git",
"master"}
fatal: remote error:
Repository not found.
Cloning into 'metamodule'...
ERROR: git clone -n git://github.com/freeakk/metamodule.git metamodule
failed with error: 128 and output:
fatal: remote error:
Repository not found.
Cloning into 'metamodule'...
ERROR: 'get-deps' failed while processing
On Sun, Oct 21, 2012 at 12:39 PM, Roberto Ostinelli <robe...@widetag.com>wr=
ote:
> For the records, this just works..
>
> start() ->
> Unicode =3D list_to_binary("=E2=88=9E-HOpe@=E2=98=BA.EXAMple.com/My=E2=9D=
=A4"),
> Result =3D list_to_binary(string:to_lower(binary_to_list(Unicode))),
> "=E2=88=9E-hope@=E2=98=BA.example.com/my=E2=9D=A4" =3D binary_to_list(Res=
ult).
>
> any downsides I'm not seeing?
>
> On Sun, Oct 21, 2012 at 12:25 PM, Roberto Ostinelli <robe...@widetag.com>=
wrote:
>
>> Thank you Lo=C3=AFc,
>>
>> did you happen to benchmark it? Would that be better/faster than a simpl=
e
>> list_to_binary(string:to_lower(binary_to_list(Bin)))?
>>
>>
>> On Sun, Oct 21, 2012 at 12:18 PM, Lo=C3=AFc Hoguin <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=C4=8Fc Hoguin
>>> Erlang Cowboy
>>> Nine Nines
>>> http://ninenines.eu
>>>
>>
>>
>
--f46d0401fea534beec04cc96fa22
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
BTW,<div><br></div><div>ux dependencies are unsatisfied:</div><div><br></di=
v><div><div><font face=3D"courier new, monospace">=3D=3D> ux (get-deps)<=
/font></div><div><font face=3D"courier new, monospace">Pulling abnfc from {=
git,"git://<a href=3D"http://github.com/nygge/abnfc.git">github.com/ny=
gge/abnfc.git</a>","master"}</font></div>
<div><font face=3D"courier new, monospace">Cloning into 'abnfc'...<=
/font></div><div><font face=3D"courier new, monospace">Pulling metamodule f=
rom {git,"git://<a href=3D"http://github.com/freeakk/metamodule.git">g=
ithub.com/freeakk/metamodule.git</a>",</font></div>
<div><font face=3D"courier new, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q=
uot;master"}</font></div><div><font face=3D"courier new, monospace">fa=
tal: remote error:=C2=A0</font></div><div><font face=3D"courier new, monosp=
ace">=C2=A0 Repository not found.</font></div>
<div><font face=3D"courier new, monospace">Cloning into 'metamodule'=
;...</font></div><div><font face=3D"courier new, monospace">ERROR: git clon=
e -n git://<a href=3D"http://github.com/freeakk/metamodule.git">github.com/=
freeakk/metamodule.git</a> metamodule failed with error: 128 and output:</f=
ont></div>
<div><font face=3D"courier new, monospace">fatal: remote error:=C2=A0</font=
></div><div><font face=3D"courier new, monospace">=C2=A0 Repository not fou=
nd.</font></div><div><font face=3D"courier new, monospace">Cloning into =
9;metamodule'...</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">ERROR: 'get-deps' failed while processi=
ng</font></div></div><div><br></div><div><br><br><div class=3D"gmail_quote"=
>On Sun, Oct 21, 2012 at 12:39 PM, Roberto Ostinelli <span dir=3D"ltr"><=
<a href=3D"mailto:robe...@widetag.com" target=3D"_blank">robe...@widetag.co=
m</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">For the records, this just works..<div><br><=
/div><div><div><font face=3D"courier new, monospace">start() -></font></=
div>
<div><font face=3D"courier new, monospace"><span style=3D"white-space:pre-w=
rap"> </span>Unicode =3D list_to_binary("=E2=88=9E-HOpe@=E2=98=BA.EXAM=
ple.com/My=E2=9D=A4"),</font></div>
<div><font face=3D"courier new, monospace"><span style=3D"white-space:pre-w=
rap"> </span>Result =3D list_to_binary(string:to_lower(binary_to_list(Unico=
de))),</font></div><div><font face=3D"courier new, monospace"><span style=
=3D"white-space:pre-wrap"> </span>"=E2=88=9E-hope@=E2=98=BA.<a href=3D=
"http://example.com/my" target=3D"_blank">example.com/my</a>=E2=9D=A4"=
=3D binary_to_list(Result).</font></div>
<div><br></div><div>any downsides I'm not seeing?</div><div><div class=
=3D"h5"><br><div class=3D"gmail_quote">On Sun, Oct 21, 2012 at 12:25 PM, Ro=
berto Ostinelli <span dir=3D"ltr"><<a href=3D"mailto:robe...@widetag.com=
" target=3D"_blank">robe...@widetag.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Thank you Lo=C3=AFc,<div><br></div><div>did =
you happen to benchmark it? Would that be better/faster than a simple=C2=A0=
<font face=3D"courier new, monospace">list_to_binary(string:to_lower(binary=
_to_list(Bin)))</font>?<div>
<div><br><br><div class=3D"gmail_quote">
On Sun, Oct 21, 2012 at 12:18 PM, Lo=C3=AFc Hoguin <span dir=3D"ltr"><<a=
href=3D"mailto:es...@ninenines.eu" target=3D"_blank">es...@ninenines.eu</a=
>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>On 10/21/2012 09:14 PM, Roberto Ostinelli wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Dear list,<br>
<br>
I've a binary string which includes accented characters and unicode,<br=
>
that i need to downcase.<br>
<br>
Is my real best option here to convert everything to list and downcase that=
?<br>
</blockquote>
<br></div></div>
Your current best option is ux_string:to_lower/1 from the ux library which =
will properly lower all characters, not just A-Z.<br>
<br>
Should be at <a href=3D"https://github.com/erlang-unicode/ux" target=3D"_bl=
ank">https://github.com/erlang-<u></u>unicode/ux</a><span><font color=3D"#8=
88888"><br>
<br>
-- <br>
Lo=C4=8Fc Hoguin<br>
Erlang Cowboy<br>
Nine Nines<br>
<a href=3D"http://ninenines.eu" target=3D"_blank">http://ninenines.eu</a><b=
r>
</font></span></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>
--f46d0401fea534beec04cc96fa22--
--===============8224250682843146801==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
--===============8224250682843146801==--