[fpc-devel] Bug in Gettext?

Michael Van Canneyt michael at freepascal.org
Fri Jan 9 14:49:08 CET 2009



On Fri, 9 Jan 2009, Klaus Reimer wrote:

> Michael Van Canneyt wrote:
> > Probably the error is in the hash code ?
> > Does GNU gettext take the #4 into account when it generates the hash code ?
> 
> gettext doesn't has its own hash method. It uses the global hash
> function defined in the objpas unit. I already wondered how this can
> work at all. Maybe its the same algorithm as used by the msgfmt tool of
> gettext. Don't know. I have no experience with hash algorithms. But this
> code generates different hash codes so maybe this proves that #4 is not
> ignored in the hash:
> 
>   WriteLn(Hash('hallo' + #4));
>   WriteLn(Hash('hallo' + #3));

Yes, 

I meant: but based on what does GNU gettext calculates the hash code ?
Is it on:
String
Context+String
Context+#4+String ?

Michael.

> 
> 
> Output:
> 
>   115880692
>   115880691
> 
> -- 
> Bye, K <http://www.ailis.de/~k/>
> [A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
> (Finger k at ailis.de to get public key)
> 
> 



More information about the fpc-devel mailing list