Support » Fixing WordPress » Unwanted characters (& -> #038)

  • Resolved trime

    (@trime)


    Hi there,

    I searched the whole web, but cannot solve this problem…

    Whenever I enter a &-character into my post (in HTML editing mode), this char gets translated to

    &#038

    I have no clue where the #038 is coming from. It seems this is the UTF translation for &. But why is & AND the #038 shown? Example:

    This: <a href="http://test-with-&-/">test</a>
    Gets: <a href="http://test-with-&#038-/">test</a>

    My configuration:
    1. WordPress 3.0.1
    2. mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2 (debian)
    3. Apache/2.2.3
    4. DB collation for all tables: utf8_general_ci
    5. DB type: utf8_unicode_ci
    6. wp-config.php: define(‘DB_CHARSET’,’utf8′); define(‘DB_COLLATE’,’utf8_general_ci’);
    7. HTML template header: <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />

    So I do use UTF, so what am I doing wrong?

    Also important:
    When I look into the DB with phpmyadmin, the post conent actually IS showing as test in the browser. It seems like somehing adds the #038 really late (during the page rendering?).

    Please help, I am stuck.

    Thanks,
    trime

Viewing 6 replies - 1 through 6 (of 6 total)
  • ‘&’ has a special meaning in (x)html. It is used exclusively to start/indicate special character references, so (if ‘ampersand’ is meant) it cannot be written as is, but must always be written as ‘& amp ;’ (or & #38 😉 (without the spaces! the forum converts the proper code to just ‘&’!). If you’ve set wordpress up to use utf8, it’s simply correcting your syntactically wrong use of ‘&’ ie on its own.

    Thread Starter trime

    (@trime)

    He thanks,

    now I see the point. Yea got it.

    Problem solved, yiha! 😉

    Thread Starter trime

    (@trime)

    He thanks,

    forget my last post.

    Problem solved, yiha! 😉

    bleggate

    (@bleggate)

    Hi Guys I too have this problem

    I have tried inserting the and; after the & symbol but it does not work.

    I have an affiliate code that contains 3 & symbols in the URL and on using it in wordpress the #038; is inserted.

    I would like to know what to change in the url or my settings to have thsese affiliate urls work without wordpress inserting the #038; symbols.

    I am all ears to your thoughts
    Thank you.

    I am using UTF-8 as an encoding (default for WordPress) and I am experiencing the same problem.

    What encoding is recommended to avoid this problem?

    I tried ASCII and that was worse.

    This is an old thread referencing an older version of WordPress. Please post a new topic.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unwanted characters (& -> #038)’ is closed to new replies.