I added a few extra character filters on the front

$find = array('’', '“', '”', ''', ' ', ' ', '“', '”', '’', '‘', '’', '‘', '“', '”', '—', '–');
      $replace = array("'", '"', '"', "'", ' ', ' ', '"', '"', "'", "'", "'", "'", '"', '"', '--', '-');
      return str_replace($find, $replace, $text);

I needed to change the character encoding for office_html.module to UTF-8 so that I could save the file, though

CommentFileSizeAuthor
#3 rimu_changes.patch906 bytesrimu

Comments

danepowell’s picture

It looks like you just moved '’', '“', '”' from the middle of $find to the front; am I mistaken?

danepowell’s picture

Status: Needs review » Needs work

Oh, I wonder if the characters are getting filtered out- if that's the case, can you convert office_html.module 6.x-1.1 to UTF-8, then generate a patch file? Thanks.

rimu’s picture

StatusFileSize
new906 bytes

Sure, here you go. I just added another character, too

Looks like my editor (correctly) isn't reading the UTF-8 characters you put into your ISO-8859 text file!

danepowell’s picture

Something still seems screwy - that patch still looks like it's encoded in ISO-8859. Are you sure that what you submitted was UTF-8?

rimu’s picture

Ugh yeah something is wrong. When did simple reliable "plain text" stop being plain?!

Can you just copy & paste the new stuff from my original post?

danepowell’s picture

Status: Needs work » Postponed (maintainer needs more info)

Your original post has a bunch of null values in the $find string - at least that's what I see in Firefox/Windows set to UTF-8.

danepowell’s picture

As an aside, I find it interesting that most (all?) files in Drupal core are encoded in ANSI, not UTF-8... (at least according to my text editor)

danepowell’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

If you're able to figure out what's going wrong and submit a working patch I'll happily accept it... otherwise I'm not sure there's anything wrong with the module as it is.