paulo1205 
		 
		(usa Ubuntu)
		 
		Enviado em 17/03/2015 - 10:05h 
		paulo1205 escreveu: 
 
Será que a versão do expr  distribuída com o o Plan 9, que supostamente trabalha com UTF-8 universalmente, suporta? 
Eu instalei o pacote 
plan9-base  no Ubuntu, e ele não traz o 
expr .
Para referência, eis a listagem de um programinha que faz o papel da função index, com suporte a caracteres acentuados, em C (com a diferença de que os 
offsets  começam a ser contados em 0, em vez de 1, e -1 indica que o padrão não foi encontrado).
    // index.c -- compile usando “gcc -std=c99 index.c -o index” 
#include <locale.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <wchar.h> 
#include <wctype.h> 
 
int main(int argc, char **argv){ 
    wchar_t *haystack, *needle, *found; 
    size_t haystack_len, needle_len; 
 
    if(argc!=3){ 
        fprintf(stderr, "usage: %s haystack needle\n", argv[0]); 
        return 1; 
    } 
 
    // Usa variáveis de ambiente para definir locale. 
    setlocale(LC_ALL, ""); 
 
    haystack_len=strlen(argv[1]); 
    needle_len=strlen(argv[2]); 
 
    haystack=calloc(1+haystack_len, sizeof *haystack); 
    needle=calloc(1+needle_len, sizeof *needle); 
 
    mbsrtowcs(haystack, (const char **)&argv[1], haystack_len, NULL); 
    mbsrtowcs(needle, (const char **)&argv[2], needle_len, NULL); 
 
    found=wcsstr(haystack, needle)-haystack; 
    printf("%zd\n", found? found-haystack: -1); 
 
    return found==NULL; 
}