Cytat(Jo-Jo @ 31.07.2012, 22:24:17 )

wszystkie rozwiązania jakie znalazłem na walidacje polskich liter właśnie tak wyglądały
Smutne ale prawdziwe. Jakość sniptów produkcji krajowej jest zatrważająca.
Cytat(Jo-Jo @ 31.07.2012, 22:24:17 )

i o ile kody ASCII liter sobie wyciągnę, to nie wiem jak je zastosować w preg_match
Musisz zrobić normalizację UTF-8, a potem już z górki :-]
Gotowca nie dam, ale polskie znaki usuwam tym sposobem:
<?php
require 'I18N/UnicodeNormalizer.php';
$normalizer = new I18N_UnicodeNormalizer(); // z PEAR
function diacritic_replace( $s ) {
// maps German (umlauts) and other European characters onto two characters before just removing diacritics
$s = preg_replace( '@\x{00c4}@u' , "AE", $s ); // umlaut � => AE $s = preg_replace( '@\x{00d6}@u' , "OE", $s ); // umlaut � => OE $s = preg_replace( '@\x{00dc}@u' , "UE", $s ); // umlaut � => UE $s = preg_replace( '@\x{00e4}@u' , "ae", $s ); // umlaut � => ae $s = preg_replace( '@\x{00f6}@u' , "oe", $s ); // umlaut � => oe $s = preg_replace( '@\x{00fc}@u' , "ue", $s ); // umlaut � => ue
// maps special characters (characters with diacritics) on their base-character followed by the diacritical mark
// exmaple: � => U�, � => a`
$s = $normalizer->normalize($s, 'NFD', 'UTF-8');
$s = preg_replace( '@\pM@u' , "", $s ); // removes diacritics
$s = preg_replace( '@\x{00df}@u' , "ss", $s ); // maps German � onto ss
// remove all non-ASCii characters
return $s;
}