Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:23:10+00:00 2026-06-13T13:23:10+00:00

This is a UTF-8 encoded source file. I must be missing something obvious, but

  • 0

This is a UTF-8 encoded source file. I must be missing something obvious, but I’ve tried all the permutations I can think of.

<?php

$bad =  array( chr(130), chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(173), chr(160) );
$good = array( chr( 44), chr( 39), chr( 39), chr( 34), chr( 34), chr( 45), chr( 45), chr( 45), chr( 32) );

print_r($bad);
print_r($good);

 $str = <<<EOF
    bad comma ‚
    bad quote ‘
    bad quote ’
    bad quote “
    bad quote ”
    bad dash –
    bad dash —
    bad dash ­
    bad space   

EOF;
    echo $str;
    $clean = str_replace($bad, $good, $str);
    echo "\n";
    echo( $clean);

And when I open it in a browser and view source…

Array
(
    [0] => ‚
    [1] => ‘
    [2] => ’
    [3] => “
    [4] => ”
    [5] => –
    [6] => —
    [7] => ­
    [8] =>  
)
Array
(
    [0] => ,
    [1] => '
    [2] => '
    [3] => "
    [4] => "
    [5] => -
    [6] => -
    [7] => -
    [8] =>  
)
    bad comma ‚
    bad quote ‘
    bad quote ’
    bad quote “
    bad quote â€
    bad dash –
    bad dash —
    bad dash ­
    bad space   

    bad comma ‚
    bad quote ‘
    bad quote ’
    bad quote “
    bad quote â€
    bad dash â€"
    bad dash â€"
    bad dash Â-
    bad space   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:23:11+00:00Added an answer on June 13, 2026 at 1:23 pm

    There is a difference between ASCII, Multibyte and UTF-8.

    In your case those characters are Multibyte Characters. “Multibyte” is just an arbitrary non-UTF-8 encoding.

    you could convert them to UTF-8 first or use mb_ereg_replace

    Most PHP Devs don’t know much about Character Encoding, but it’s one of the most important things when working in C/C++.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All my python source code is encoded in utf-8 and has this coding declared
I am interested in writing utf-8 encoded strings to a file. I did this
I know there are hundreds of questions about UTF-8 woes but I tried all
i use pdflatex to generate pdf files. my source files are all utf-8 encoded
I have MySQL InnoDB table utf-8 encoded. This table has only id and name
I have a json file exported from phpmyadmin, it looks like this(utf-8 file): [{user_email:
I have a file, which I read from test . This file is UTF-8.
this is my sample code, however I used HttpProtocolParams.setContentCharset(params, utf-8); im my code but
I am trying to import data from a utf-8 encoded flat file into SQL
I have some the folowing requirements: ...The document must be encoded in UTF-8 ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.