PHP Classes

adaptions for german language and utf-8

Recommend this page to a friend!

      Spell Corrector  >  All threads  >  adaptions for german language and utf-8  >  (Un) Subscribe thread alerts  
Subject:adaptions for german language and utf-8
Summary:german utf-8
Messages:1
Author:Peter Udem
Date:2015-05-13 18:16:10
 

  1. adaptions for german language and utf-8   Reply   Report abuse  
Picture of Peter Udem Peter Udem - 2015-05-13 18:16:10
I did some changes to adapt the script to utf-8 encoding and german language:

1. insert

mb_internal_encoding("UTF-8");

class SpellCorrector {


2. substitute

preg_match_all("/[a-zäöüß]+/",mb_strtolower($text),$matches);


3. substitute

$alphabet = 'abcdefghijklmnopqrstuvwxyzäöüß';


4.

change some string-functions to mb_ substitution:

strlen -> mb_strlen
strtolower -> mb_strtolower
substr -> mb_substr

that works well