I want to execute the following Objective-C code in my Rails application:
CFMutableStringRef inputString = CFStringCreateMutableCopy(kCFAllocatorDefault, 32, CFSTR("общей"));
CFLocaleRef locale = CFLocaleCreate(kCFAllocatorDefault, CFSTR("ru"));
CFStringTransform(inputString, NULL, kCFStringTransformStripDiacritics, false);
CFStringLowercase(inputString, locale);
NSLog(@"%@", (NSString *)inputString);
CFRelease(locale);
CFRelease(inputString);
It basically outputs a lowercase, diacritics-free version of the input string. I am running on a Snow Leopard server.
How can I do this (without using MacRuby, which seems to be an overkill here)? I've heard of Ruby extensions but can't find any resources in my case.