Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Sorting for UTF-8 characters
Sailesh
Hi,
I am facing a issue with sorting utf-8 characters, when I sort words like Česká republika and �rsko appear at the last of the list and not in their proper place like C and I.
I tried using use locale; and other documentation regarding the same but it did not work for my code.
Find more posts tagged with
Comments
Adam Stoller
What version of TeamSite?
What platform?
What coding language?
Can you show the code and some sample input/output?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Valentine
locale settings.
If you are on Solaris,
check the values of LC_COLLATE, this environment variable is responsible for the sorting.
Windows, don't know.
Sailesh
Information regarding the enviornment..
Teamsite version 6.1
Perl 5.8.2
Solaris
Sample code
<iw_perl>
use HTML::Trimmer2;
use locale;
</iw_perl>
foreach my $key (sort {lc($a) cmp lc($b)} keys %corporate) {
my $value = $corporate{$key};
if ($value =~ /href="(.*?)"/) {
$value = $1;
}
$value =~ s[Source=DIR][Source=SDDD];
(my $text = $key) =~ s['][\\\'];
iwpt_output("
document.write('<option value=\"$value\">$text</option>');
");
}
Edited by Sailesh on 05/04/05 03:04 AM (server time).