[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: removing diacritical marks from strings
- From: Jay Carlson <nop@...>
- Date: Sun, 15 Apr 2007 20:56:49 -0700
This is all predicted on being in a single-byte locale of course. "." only matches a byte, not a character.
When Modula-3 came out, we thought it was a little daring and progressive to define the language as ISO Latin-1 rather than ASCII....
Sent from a Treo, excuse infelicities
From: "Luiz Henrique de Figueiredo" <firstname.lastname@example.org>
To: "Lua list" <email@example.com>
Sent: 4/15/07 5:34 PM
Subject: Re: removing diacritical marks from strings
> Does anybody happen to have a mapping (or an algorithm) that will
> remove diacritical marks from strings? I'd like to convert Jérôme to
> Jerome and that sort of thing.
Try something like this (untested):
['A'] = "ÀÁÂÃÄÅ",
['E'] = "èéêë",
for i=0,255 do
for k,v in pairs(t) do
for i=1,#v do
now use string.gsub(source,"(.)",T)