From d54190f6ca0aac8b08bb59370c53932771933c40 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 29 Apr 2006 15:55:51 +0000 Subject: lcfirst/ucfist plus an 8 bit locale could mangle UTF-8 values returned by overloaded stringification. p4raw-id: //depot/perl@28013 --- t/uni/overload.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/uni/overload.t b/t/uni/overload.t index 407d4c6a88..38328f1e97 100644 --- a/t/uni/overload.t +++ b/t/uni/overload.t @@ -7,7 +7,7 @@ BEGIN { } } -use Test::More tests => 16; +use Test::More tests => 24; package UTF8Toggle; use strict; @@ -72,5 +72,21 @@ SKIP: { $uc = uc $u; is (length $uc, 1); is ($uc, "\311", "e accute -> E accute"); + + $u = UTF8Toggle->new("\311"); + $lc = lcfirst $u; + is (length $lc, 1); + is ($lc, "\351", "E accute -> e accute"); + $lc = lcfirst $u; + is (length $lc, 1); + is ($lc, "\351", "E accute -> e accute"); + + $u = UTF8Toggle->new("\351"); + $uc = ucfirst $u; + is (length $uc, 1); + is ($uc, "\311", "e accute -> E accute"); + $uc = ucfirst $u; + is (length $uc, 1); + is ($uc, "\311", "e accute -> E accute"); } } -- cgit v1.2.1