Re: better string sorting?
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....
///////////////////////////////////////////////////////
Re: better string sorting?
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!
Re: better string sorting?
Re: better string sorting?
Write your own code . Only God can correct Microsoft's error ;-)
Re: better string sorting?
no problem write it but how to add into system?
Re: better string sorting?
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
Re: better string sorting?
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?
Re: better string sorting?
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.
Re: better string sorting?
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)
Re: better string sorting?
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
Re: better string sorting?
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
Re: better string sorting?
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.
Re: better string sorting?
maybe we going out of theme (how to get into (ms) system to correct bug) but what speaks posix about (my-languate) string comparation?
Re: better string sorting?
> 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
Re: better string sorting?
yes (or maybe better say for 99.9% is good but for some cases not)
Re: better string sorting?
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
Re: better string sorting?
did you ever received any reply from microsoft? ok, i can try it again
Re: better string sorting?
Yes, I have received a reply when I have reported product bugs through official support channels.
Dave
Re: better string sorting?
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.
Re: better string sorting?
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!
Re: better string sorting?
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
Re: better string sorting?
and here is RD reply:
"it is not bug for us (from global aspect)"
"not enought slovak customers"