Forum: Ruby downcase/uppercase for non-English characters

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-03-18 22:34
(Received via mailing list)
Hello.

Can subj be done for 1-byte (non-Unicode) encodings, particularly
windows-1251 (Russian).

Are there some interpretor options or third-party libraries for
locale-specific operations?

Thanks.

Victor.
5f9c8fb2306894775f9b7fe2803a1685?d=identicon&s=25 serbulentu@gmail.com (Guest)
on 2006-03-19 01:35
(Received via mailing list)
Hi

As Turkish users we have same problems not only in windows-1254 also
utf-8 and i think as a japanese user Matz have same problems also. I
read a solution in a turkish forum may be u can use it. They says for
unicode use jcode=u  and write your own regex for downcase/uppercase
functions. So if yu do that inthe ruby code all libraries which use
that function will use your function. But this problem will be fixed in
2.0 version of Ruby.

Serbulent UNSAL
2c7c807a1df0c76a8fc823c709b501a9?d=identicon&s=25 Victor Shepelev (Guest)
on 2006-03-19 01:35
(Received via mailing list)
> As Turkish users we have same problems not only in windows-1254 also
> utf-8 and i think as a japanese user Matz have same problems also.

Hmmm... It seems to me Japanese has no upper/downcases.

> I
> read a solution in a turkish forum may be u can use it. They says for
> unicode use jcode=u  and write your own regex for downcase/uppercase
> functions. So if yu do that inthe ruby code all libraries which use
> that function will use your function.


Yes, I know how to use Unicode (but I don't want), and know how to write
custom upper/downcase via String.tr (and I've already wrote). What I
can't
handle, is case-insensitive Regexp-matching :-\

> But this problem will be fixed in
> 2.0 version of Ruby.

Would hope, but can't wait :)

In any case, thanks for your help.

> Serbulent UNSAL

Victor.
Ff260830c27224f0e15f37362a6256d0?d=identicon&s=25 Paul Duncan (Guest)
on 2006-03-28 21:47
(Received via mailing list)
* Victor Shepelev (vshepelev@imho.com.ua) wrote:
> Hello.
>
> Can subj be done for 1-byte (non-Unicode) encodings, particularly
> windows-1251 (Russian).
>
> Are there some interpretor options or third-party libraries for
> locale-specific operations?

The Unicode property support that can be compiled in to PCRE.  I know
There are PCRE bindings for Ruby as well, although I have no idea how
functional they are.

Obviously in order for this to work, you'd need to use Iconv to
convert the data into PCRE-friendly UTF-8.
This topic is locked and can not be replied to.