• Hi.

    I noticed that my data (e.g. “televisión”) is stored with special characters (“televisión”). I want to manipulate them, and I don’t succeed in doing it.

    Can I store it “normally”? Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The encoding of your characters you see is utf8 – this is needed to store the non-ascii characters in the database it is converted backwards and forwards by wordpress/your browser automatically.

    Where are you trying to manipulate the characters? In a plugin?

    westi

    Thread Starter guarriman

    (@guarriman)

    Yes, I’m creating a PHP-plugin which uppercases text. However, I’m unable to do it.
    strtoupper(“televisión”) =====> TELEVISIóN
    It’s due to special characters (instead of ‘televisión’, I’m trying to uppercase ‘televisión’).

    Ok there are two ways that you could achieve this:

    1. Use iconv to convert the string from UTF-8 to the correct ISO charset for spain apply your conversions and then use iconv to convert back to UTF-8 – This will only work if the locale on the machine running the php code is set to be spanish other wise strtoupper won’t convert the accented letters.
    2. Use mb_strtoupper() which looks like it will handle the multibyte (UTF-8) characters correctly for you

    hope this helps

    westi

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to store Spanish characters’ is closed to new replies.