Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Eregi expression major bug, no? The "i" thing...

    Short and clear:

    i modifier (case insensitive) does NOT work for Cyrilic layouts (such as windows-1251)

    Example:
    Imagine XXXX is written in Cyrilic characters, not English..

    We have a search form. A script searches a file for the criteria specified by this form. The script contians a modifier i for case insensitive matching...

    WHAT IS THE PROBLEM, you will ask me.


    Well, here is the situation:

    Search criteria: Dog
    Finds in file: Dog DoG and DOg if they exist.

    Search criteria: Xxxx
    Finds in file: ONLY Xxxx if it exists - exact phrase, case sensitive matching for Cyrilic letters in ONE AND THE SAME SCRIPT

    Could anybody please give a reasonable explanation of that bizarre issue?

  • #2
    Regular Coder
    Join Date
    Jun 2005
    Posts
    804
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cyrillic is a multibyte character set, and standard PHP string functions are designed for single-byte charsets. You need to work with PHP's multibyte string functions.

  • #3
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    AFAIK support for unicode is a key feature of PHP6...
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #4
    New Coder
    Join Date
    Feb 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just tell me there is a multibyte replacement for
    PREG_MATCH
    PREG_SPLIT

    because using
    MB_EREGI
    MB_SPLIT
    instead did not work...

  • #5
    Regular Coder
    Join Date
    Jun 2005
    Posts
    804
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you sure the mbstring extension is enabled in your installation?

  • #6
    New Coder
    Join Date
    Feb 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, the site is located on a hosting company's server.. I should ask the support team.. but still.. I am pretty sure MB's enabled..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •