tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Re: TCC:cannot find -l"xyz.dll"


From: lostgallifreyan
Subject: Re: [Tinycc-devel] Re: TCC:cannot find -l"xyz.dll"
Date: Thu, 9 Apr 2009 00:50:14 +0100

Dave Dodge <address@hidden> wrote:
(08/04/2009 21:51)

>> No generic case comparion OR forcing in C?
>
>Not for complete strings.  There are case-folding functions for
>individual characters, and you can trivially case-fold a string by
>iterating over its content.  Something like this, perhaps:
>
>  for (unsigned char * p = s;*p != '\0';p++)
>      *p = tolower(*p);
>
>> Lua is based in C
>
>Lua's "string.upper" function constructs a new string by calling C's
>"toupper" function on each of the original string's characters.  The
>"string.lower" function does the same thing using "tolower".
>

Thanks, that will work for me. I'm beginning to see the value of Lua in ways I 
never did, despite valuing it very highly already though. Even there I wrote 
several common functions for doing stuff I wanted as basic staple diet. C 
appears to want me to re-invent many a wheel.. I'll try to study what Lua2c 
does in its conversions, and see where things I use a lot can better be 
rewritten purely in C. That looks like my fastest way to adapt.

>Aside: C also has case-folding functions for wide characters, but they
>probably aren't sufficient to handle Unicode because they just have
>single characters as input and output.  Unicode's case folding
>algorithms sometimes change the string length.  For example the German
>sharp-s is a single character in lower case but two characters in
>upper case, and Greek has even more complex conversions.
>
>There's also the issue that some letters fold differently based on the
>source language.  C's locale support might be able to deal with this
>if you adjust the locale to match the text being processed (rather
>than the user environment).  For example the case conversions for "i"
>and "I" are different in Turkish than in English.  In one bizarre
>situation, using the English conversions on some Turkish text
>apparently set off a chain of events leading to multiple homicides:
>
>http://www.gizmodo.com.au/2008/04/a_cellphones_missing_dot_kills_two_people_puts_three_more_in_jail-2.html
>

Nasty. So far I haven't had to rely on Unicode though, where possible I've 
tried to find ways to use characters in ANSI encoded ASCII. Only had to use 
English language so the issue is mainly one of punctuations. I'll experiment 
with locale setting changes and case folding though, if I ever need to consider 
the effects.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]