www.webdeveloper.com
Results 1 to 2 of 2

Thread: Collation problem?

Hybrid View

  1. #1
    Join Date
    Mar 2012
    Posts
    2

    Collation problem?

    I am having a problem with some data in my database. I am storing Magic: The Gathering card names in a database along with all of the data associated with each card, and allowing the members of my website to build deck lists for the game.

    Once the users enter the deck list in a form (in plain text) I search the database to verify that each card is a real card using a php function I wrote. If the card name given by the user is not found in the database, I do not allow the card to be stored in the deck list.

    Problem is that some cards have special characters such as "" that, although they do show up in the database (using utf8 collation), for some reason the search will fail to find the card. I am a little puzzled by this. I have even copied and pasted the data as it appears in the database directly into the form, and it still does not find the card. Very puzzling to me.

    Can someone please tell me how to solve this? Is there something special I need to code in PHP? Or should I be using a different collation other than UTF8?

    According to this UTF8 Unicode chart "" is a UTF8 character.

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    As a band-aid solution (which won't actually fix anything) you could always use RegEx to replace special characters with a wildcard "%" in the search text, that way "Æther Charge" would be searched in the database as "%ther Charge", thus giving you "Æther Charge".
    |||||
    o . Q
    ___ "You live and you learn; or you don't live long." - Lazarus Long

    ^_^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles