Author |
Topic: Locale aware memcmp function (Read 785 times) |
|
Margit
Junior Member
Gender:
Posts: 54
|
|
Locale aware memcmp function
« on: Feb 7th, 2007, 9:53am » |
Quote Modify
|
As per subject. How does one go about doing a memcmp that is aware of the LC_COLLATE setting ? Yes, I know there is strcoll, but the things I am comparing have fixed widths (not null-terminated) and may contain null bytes. It seems that there is no standard C library function to do this.
|
|
IP Logged |
|
|
|
Margit
Junior Member
Gender:
Posts: 54
|
|
Re: Locale aware memcmp function
« Reply #2 on: Feb 7th, 2007, 11:39am » |
Quote Modify
|
On 'nix systems - man locale man setlocale man strcoll man memmp
|
|
IP Logged |
|
|
|
Margit
Junior Member
Gender:
Posts: 54
|
|
Re: Locale aware memcmp function
« Reply #4 on: Feb 7th, 2007, 11:45am » |
Quote Modify
|
> What is LC_COLLATE? Don't you know what how to sort ? :-)
|
|
IP Logged |
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Locale aware memcmp function
« Reply #5 on: Feb 7th, 2007, 10:24pm » |
Quote Modify
|
How about this, 1. Copy the strcoll source to another function say "memcoll". 2. Remove the null termination condition from it. -- AI
|
|
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Locale aware memcmp function
« Reply #6 on: Feb 7th, 2007, 10:26pm » |
Quote Modify
|
Well what do you know, Google CodeSearch Memcoll Hail, google codesearch -- AI
|
« Last Edit: Feb 7th, 2007, 10:30pm by TenaliRaman » |
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
Margit
Junior Member
Gender:
Posts: 54
|
|
Re: Locale aware memcmp function
« Reply #7 on: Feb 8th, 2007, 9:20am » |
Quote Modify
|
That actually is busted and uses strcoll. Other ideas ?
|
|
IP Logged |
|
|
|
|