2

I have a txt file (File encoded in ANSI according to Notepad++) that has '…' in it. I am reading in the file line by line, and I would like to replace with ...

Everything I try seems to fail

  1. $str = htmlentities($str); # trying to convert to … as I can deal with this
  2. $str = mb_ereg_replace("…","...",$str);
  3. $str = str_replace("…", "...", $str);

All of the above aren't working! What am I missing and how can I fix this issue?

NOTE: My php script that is trying to fix this is encoded in UTF8 and the php header is UTF8

Thanks in advance for any help!

1
  • 1
    If you open the txt file in a hex editor, what bytes represent the ? Commented Nov 26, 2011 at 22:54

1 Answer 1

6

As you said it is represented with the byte 0x85 in the file, try this:

$str = str_replace("\x85", "...", $str);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.