# How to replace a replacement glyph

**URL:** <https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052>\
**Category:** Factual Questions\
**Created:** [February 22, 2013, 4:21am UTC](https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052 "2013-02-22T04:21:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [February 22, 2013, 4:21am UTC](https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052/1 "2013-02-22T04:21:51Z")

</div>

I often copy material I’ve found online to a Word document. (For personal use, of course.) There are zillions of codes online and I find some don’t translate well.

Specifically, some render characters in Word as a replacement glyph:

> [@](#):
>
> In many web browsers and other computer programs, “?” is used to show a character not found in the program’s character set. This commonly occurs for apostrophes and quotation marks when they are written with software that uses its own proprietary non-standard code for these characters, such as Microsoft’s Smart Quotes. Some fonts will instead use the Unicode Replacement Glyph (U+FFFD, �), which is commonly rendered as a white question mark in a black diamond (see replacement character).

Word doesn’t want to replace these because it doesn’t even recognize them as characters, not even why copy-and-pasted into the Replace box. The Unicode glyph is a real nuisance.

If there a way to force Word to see these glyphs to get rid of them?

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [February 22, 2013, 5:03pm UTC](https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052/2 "2013-02-22T17:03:35Z")

</div>

Consider this:

[ol]  
[li]Save your Word document as a text (.txt) file[/li][li]Open up the text file in a real text reader (say, Notepab++)[/li][li]Do a search and replace on the unicode character and save the file.[/li][li]Open the text file in Word and save it as .doc or .docx file.[/li][li]Apply formatting to the reconstituted document.[/li][/ol]

Or better still, initially save your online material as a text file, clean out any unicode, then go the Word route.

---

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [February 22, 2013, 5:40pm UTC](https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052/3 "2013-02-22T17:40:03Z")

</div>

That’s a good workaround. Thanks.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [February 22, 2013, 7:15pm UTC](https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052/4 "2013-02-22T19:15:25Z")

</div>

I also found that the usual tricks of getting special characters in the find/replace box didn’t work for this character. But the limitation is just with the GUI box, not the underlying function, so you can write a Visual Basic macro to do this. I don’t know what version of Word you have or how much you know about macros, so I don’t know whether you need detailed instructions or how to write them. Here’s one way to do it in Word 2007:  
[ol]  
[li] Start recording a macro (Developer tab \> Record Macro). Name it whatever seems appropriate, say “replaceFFFD”. If you want to use this on all of your documents, store it in Normal.dotm; if just on this one, you can store it with the current document.[/li][li] Go to the beginning of the document (ctrl-Home) so that the replace operation will cover the whole document.[/li][li] Open the Replace dialog (ctrl-H) and type something in the Find box, and then click “Replace All”. (If you want to make sure things are working you can use a string that’s in your document.) Click OK on the new dialog and close the Replace dialog.[/li][li] Stop recording (the “Stop Recording” button).[/li][li] Open up the macros for editing (“Macros” button in the Developer tab). Find your macro and click “Edit”. Find the text you typed in the Find box; it should be on a line like[/li]

```auto

 .Text = "abc"

```

(with your Find string in quotes). Replace the quoted string with the character you want to delete, giving

```auto

 .Text = ChrW(65533)

```

(65533 is the decimal equivalent of the hexadecimal FFFD; there are no quotes).  
[li] Run the macro (the green right-pointing “Play” triangle in the VB editor menu bar, or F5). This should get rid of the offending character. (If you like you can bind this macro to a key or button, or you can run it later from the Macros dialog.)[/ol][/li]The whole macro should look something like this:

```auto

Sub replFFFD()
'
' replaceFFFD Macro
'
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(65533)
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

```

---

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [February 22, 2013, 9:13pm UTC](https://boards.straightdope.com/t/how-to-replace-a-replacement-glyph/651052/5 "2013-02-22T21:13:03Z")

</div>

Interesting. I’ll have to try that. I have Word 2010, but that’s so similar to 2007 that I assume this will work.
