Click to See Complete Forum and Search --> : better string sorting?
real name
June 11th, 1999, 05:48 AM
does anybody know how to make my language string sorting functional
microsoft's version has some bugs
when i debug it it goes from CString to kernel32.dll
exists any API-hook?
i looking for any system solution, not for my program only
thanks for reply
t!
Hochgebe
June 14th, 1999, 04:15 PM
You could write your oun sorting function... Perhaps a quick sort or something. If you need instructions on how to go about doing this (or you'd like to see one) just say so.
///////////////////////////////////////////////////////
Good things come to those who wait...
But they come used by the impatient....
///////////////////////////////////////////////////////
real name
June 14th, 1999, 11:30 PM
sorry, it seems like misunderstanding, maybe i wrote it wrong way
i'm looking for possiblility to hook system string-compare actual-language-depending function
for my language (slovak) it works not properly
call quickly ends in kernel32.dll and i do not see any possibility how to improve it (i know how to write functional comparing function(s) but how to add them to the system?)
thanks for reply
t!
real name
July 25th, 1999, 02:43 AM
noone knows?
July 25th, 1999, 03:16 AM
Write your own code . Only God can correct Microsoft's error ;-)
real name
July 25th, 1999, 11:24 PM
no problem write it but how to add into system?
eric33
July 26th, 1999, 03:40 AM
What comparaison functions do you use ?
Do you use the CString compare methods ?
If yes then make your own class derived from CString and change the method you want to implement.
Example :
class CMyString : public CString {
public:
CMyString();
// operators
BOOL operator >=( const CString& s1, const CString& s2 );
};
The methods you implement in your class will be called in place of the methods of the CString.
Hope this helps
real name
July 26th, 1999, 03:47 AM
easy but another softwares like excel etc will still not work correctly
it is quite stupid for sorting export data to ascii, use my old good dos program and then import them back
how to get into system?
eric33
July 26th, 1999, 05:31 AM
The only method i know to compare strings is to compare integer value of each ascii byte.
Therefore i dont think you can change the system to have ALL programs a good method to compare strings because each program use their own compare code (for example CString, strcmp, ...).
Perhaps i am wrong but still think there isn't a system level solution.
real name
July 26th, 1999, 05:43 AM
you wrong
this call ends in somewhere in kernel32, (where continues?) and is national setting dependent
what is your language? for example in english is letter order aAbB etc i think but in ascii is ab...AB (AB...ab?)
in my language are letters like á, ó etc. which are in ascii order long time after english letters (and some next details)
Dave Lorde
July 26th, 1999, 06:13 AM
Have you looked at the Standard Template Library 'string' class and the 'collate' class in the <locale> header. Collate is a locale facet that can control comparisons of character sequences according to your locale settings.
Dave
real name
July 26th, 1999, 06:20 AM
hi dave
sorry but you lost last discussion
no problem with wrong national settings but that for my national setting it doesn't work properly for whole situation and i looking for way correct it
F. Petitjean
July 26th, 1999, 08:14 AM
I think the situation is hopeless. If you consider the fact that the source code of the offending modules is carefully hidden and the precedent of the Icelandic scandal (the Icelandic government proposed to pay Microsoft to write a version of Windows which supports the icelandic language).
Your corporation/administration should set some buying guide lines, for example that an Operating System that does not follow a minimum set of standards (POSIX, ANSI, ... ) may not be purchased. The slovak government should also formally ask Microsoft about its position relative POSIX compliance.
Regards.
real name
July 26th, 1999, 08:40 AM
maybe we going out of theme (how to get into (ms) system to correct bug) but what speaks posix about (my-languate) string comparation?
Dave Lorde
July 26th, 1999, 09:16 AM
> for my national setting it doesn't work properly for whole situation
I don't understand what you mean by this. Are you saying the system collation sequence for your country is wrong?
Dave
real name
July 26th, 1999, 09:35 AM
yes (or maybe better say for 99.9% is good but for some cases not)
Dave Lorde
July 26th, 1999, 09:51 AM
OK, I guess all you can do is tell Microsoft what the locale code page errors are, and ask if they can correct it.
Unless there's a user-friendly way of dynamically installing a new locale code page, I doubt that it can be fixed without a service pack.
Dave
real name
July 26th, 1999, 10:05 AM
did you ever received any reply from microsoft? ok, i can try it again
Dave Lorde
July 26th, 1999, 10:08 AM
Yes, I have received a reply when I have reported product bugs through official support channels.
Dave
F. Petitjean
July 26th, 1999, 10:11 AM
With a POSIX compliant system, (Windows NT is advertised as having a POSIX subsystem, only for console applications and without any explanations on how to build and run a POSIX application) you have following specifications and library calls with C bindings :
application should call setlocale()
To compare two strings according to the current locale (current language) use strcoll(), strxfrm() + strcmp() (or wsxfrm() on Solaris)
you can set/modify the current locale by changing some environment variable (LANG LC_COLLATE)
On some systems, you can create your own string collating routines (exactly what you need?) by running a simple executable (colltbl) with a file as argument with following content :
codeset telephone # OutputFilename
order is (A;a);(B;b);(C;c);(CH;Ch;ch);(D;d); ...
substitute "0" with "zero"
...
So, you can handle following cases :
Ordering of single characters in the codeset
Equivalence class definitions. (collection of characters with the same primary sort value)
Ordering of double characters in the collation sequence. ch in Spanish is collated after c.
Ordering of one character as if it consists of two characters es-zet in german is sorted as if it were ss.
Substitution of one character string with another character string (months and day names...)
Null character maping: certain characters in the codeset are ignored during collation ( re-locate == relocate if "-" is ignored )
Secondary ordering between characters. (in French e and é have same primary ordering, eé follows e in secondary ordering).
[ information about colltbl is extracted of the colltbl(1M) man page on Solaris ]
So, you have a very powerful and extensible system.
size_t strxfrm( char *dst , const char * src , size_t n );
strxfrm() transforms the string src and places the resulting string into the array dst. If strcmp() is applied to two transformed strings, it will return the same result as strcoll() applied to the same two original strings.
You can implement these ideas. I know that it would not fix software you don't develop (Excel), in this case you have to show my preceding post to your boss.
I hope that helps.
real name
July 29th, 1999, 07:44 AM
hi after 3 days
i send to local ms what is wrong and they replyed
they writen me how it works now
at my next mails until this time no reply
i will inform when something happend
t!
real name
August 2nd, 1999, 02:18 AM
now i got next reply from local microsoft:
we afraid this is not problem/bug
but try to contact another person - regional director, maybe he can help you
so i sent mail to him
we will see
real name
August 2nd, 1999, 06:06 AM
and here is RD reply:
"it is not bug for us (from global aspect)"
"not enought slovak customers"
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.