News for hackers. Stuff that matters.
Re:A collection of high performance c-string transformations by Groxx on Sunday March 28, 2010 @11:06PM (#1225712)
Does it have UTF / other format support? I really have no use if it doesn't, and I don't see anything mentioning it on the first page.
Re:A collection of high performance c-string transformations by klodolph on Monday March 29, 2010 @12:31AM (#1225806)
This was my question, so I looked at the source. It refers to a page on algorithms that claims that it is 8-bit clean, i.e., it preserves non-ascii characters but does not modify them. I then compiled a test program to verify this, because the bit twiddling in the source code looks a little nuanced. It IS 8-bit clean.

Although, if you're looking for something that converts non-ascii characters to their lower case equivalents, just use LibICU. This library looks nice for decoding things like HTTP which have plenty of ascii-only case insensitivity.

Re:A collection of high performance c-string transformations by mbreese on Sunday March 28, 2010 @11:21PM (#1225724)
Since it is doing bit manipulation, then probably not. I mean, the toupper function is treating (4) 8 bit chars as one 32 bit uint. Then doing math... so, I assume that it will miss the finer points of I18N.

However, the base64/85 en/decoders should work just fine.

Re:A collection of high performance c-string transformations by jws on Monday March 29, 2010 @01:30AM (#1225879)
And in the same vein as the nginx optimizations suggested in a comment yesterday, it fails on arcitectures that don't support unaligned access.
Re:A collection of high performance c-string transformations by malkia on Monday March 29, 2010 @05:09AM (#1226155)
Funny, but typing CString in google reveals some new interesting products.
Re:A collection of high performance c-string transformations by DrJokepu on Monday March 29, 2010 @06:34AM (#1226240)
Great stuff, it's a shame it doesn't work on Windows (yet). Makes me want to spend the rest of my day trying to port it to MSVC.
Re:A collection of high performance c-string transformations by shin_lao on Monday March 29, 2010 @08:07AM (#1226341)
You can use <boost/cstdint.hpp> http://www.boost.org/
Re:A collection of high performance c-string transformations by sid0 on Monday March 29, 2010 @08:06AM (#1226333)
Surely if stdint is all that's missing, http://code.google.com/p/msinttypes/ will work?
Re:A collection of high performance c-string transformations by halostatue on Monday March 29, 2010 @11:25AM (#1226679)
Re:A collection of high performance c-string transformations by sausagefeet on Sunday March 28, 2010 @10:48PM (#1225684)
I've been looking for a high performance toupper lately too.