[TxMt] Compare two strings ignoring multibytes

Juan Falgueras juanfc at uma.es
Thu Aug 20 23:37:32 UTC 2009


	Hi

desperate looking for a way of a more relaxed way of searching a  
string inside another, we need not to take into the account not only  
the case

   s = "Abc"
   if s =~ /abc/i then
     …

but also if you have forgotten an accent, etc:

   s = "áBc"
   if s =~ /abc/i then
     …also should match!

Changing the encoding to the simplest one: ASCII,  does not work since  
iconv, nor ruby force_encoding() work and gives you errors in case you  
try to convert "á" to "a"

MacOS does the work but it is not the appropriate way here…

Any help will be welcome.

- juanfc





More information about the textmate mailing list