From: Jarkko Hietaniemi Date: Tue, 16 Oct 2001 02:27:51 +0000 (+0000) Subject: Document the problem with the swash_fetch() API that affects X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=035d37be8456f0df63748a1c95063999b5824c09;p=p5sagit%2Fp5-mst-13.2.git Document the problem with the swash_fetch() API that affects more complex case conversions. p4raw-id: //depot/perl@12450 --- diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index bbc082b..fe286d9 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -159,6 +159,7 @@ sub SWASHNEW { # NOTE: utf8.c:swash_init() assumes entries are never modified once generated. sub SWASHGET { + # See utf8.c:Perl_swash_fetch for problems with this interface. my ($self, $start, $len) = @_; local $^D = 0 if $^D; my $type = $self->{TYPE}; diff --git a/utf8.c b/utf8.c index e1a7e63..0c09469 100644 --- a/utf8.c +++ b/utf8.c @@ -1281,6 +1281,12 @@ Perl_swash_init(pTHX_ char* pkg, char* name, SV *listsv, I32 minbits, I32 none) return retval; } + +/* This API is wrong for special case conversions since we may need to + * return several Unicode characters for a single Unicode character + * (see lib/unicore/SpecCase.txt) The SWASHGET in lib/utf8_heavy.pl is + * the lower-level routine, and it is similarly broken for returning + * multiple values. --jhi */ UV Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr, bool do_utf8) {