Page 1 of 1

Search / replace words with accents

Posted: Sun Oct 07, 2012 3:03 pm
by hayworth
Is it possible in Textpad search / replace words with accents?

I have in Preferences of Textpad:
Configure/Preferences/Document Classes
for all the Document Classes: UTF-8 in 2 places: Write BOM and Default Encoding

When a look for
<span class="smcap">Beristáin</span>
with search:
<span class="smcap">\([^<]*\)</span>
replace:
<span class="smcap">\U\1</span>

I got:
<span class="smcap">BERISTáIN</span> ("á" don't change)

I tried with other combinations like:
search:
<span class="smcap">\([^<]*[a-zA-Z áéíóú�É�ÓÚÑñÜü]+\)</span>
replace:
<span class="smcap">\U\1</span>

but not success.

Any ideas? Thank you.

Posted: Sun Oct 07, 2012 7:31 pm
by ben_josephs
Unfortunately, although TextPad itself knows that the uppercase versions of á, é, í, ó, ú are �, É, �, Ó, Ú, its tired old search engine (in both literal and regex mode) doesn't. If, for example, you search for á it won't find �, and vice versa, regardless of whether you've selected Match case. And if, using Search | Replace you ask it to replace á with its uppercase version it will leave it as it is. There's nothing you can do about this.