Searching by Unicode codes

D

da9ve

The MS help page
(http://office.microsoft.com/en-us/word/HA012303921033.aspx?pid=CH100626221033#7)
tells me that I should be able to do a search in Word (I'm using both Ofice
Pro 2003 SP3 and Office Pro 2007) for a Unicode character by its code, using
the syntax ^Unnnn (where nnnn is the Unicode codepoint) with Use Wildcards
turned off.

For the life of me, I have not been able to get this to work. I only get
"^U is not a valid special character for the Find What box" when I try this
method. I've tried every alternate I can think of, ^unnnn, u+nnnn, U+nnnn,
with and without quotation marks, with and without matching
fullwidth/halfwidth characters, and about twenty more permutations of various
search options enabled and disabled, and either get a variation on that "not
a valid special character" error, or just a "The search item was not found"
when Word's not even recognizing that I'm telling it to look for some kind of
special character code.

What method actually works? Does the fact that I have several non-default
multi-language options enabled in Word make a difference?
 
S

Suzanne S. Barnhill

IIRC, the issue is that you have to use decimal numbers instead of hex.
There's nothing within Word that will actually make that conversion for you,
but there are numerous Web sites that can do it.

Alternatively, you may be able to copy and paste (Ctrl+V) the character into
the dialog. Even if it isn't displayed correctly, the Find may work.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
D

da9ve

Suzanne S. Barnhill said:
IIRC, the issue is that you have to use decimal numbers instead of hex.
There's nothing within Word that will actually make that conversion for you,
but there are numerous Web sites that can do it.

Well, I've tried hex and decimal, and it didn't change anything. Anyway,
using a four-digit hex number that happens to have only numeric characters,
how would Word know whether it's hex or decimal? I presumed, and then
tested, that they don't need to be entered in hex as 0xnnnn, making the whole
search string ^U0xnnnn, for example - no luck there, and similarly no luck
sticking to decimal numbers, with or without leading 0's. (Granted, nothing
anywhere has suggested the nnnn's had to be in hex, but since that's how
Unicode codepoints are generally referred to, it seems to make sense that
they should.)

FYI, I've tried entering in the Find What box, the following examples, among
many others:

^U201D
The decimal equivalent of that, ^U8221
^U005D
^U5D (thinking, maybe leave off the leading 0's)
^U93 (the decimal equivalent of that, with no leading 0's)
^U0x201D

EVERY TIME I start the search string with ^U, I get only the "^U is not a
valid special character for the Find What box." That's 100% consistent so
far.

^u5D (lower-case u)
^u0x005D
^u005D

....and several more variations on that. Also 100% consistent is that EVERY
TIME I start the search string with ^u (lower case), I only get back "Word
has finished searching the document. The search items was not found."

Interestingly, I get this even when I purposely make sure that exact string
DOES appear in the document, which tells me Word IS somehow using the ^ (and
maybe the u) to indicate some kind of special character, since it's not
finding a literal string that's there. And, even with quotes around it to
purposely search for that literal string and not just a character it stands
for, never returns a hit - which makes me think that some OTHER setting is
affecting the Search feature in a bigger way.

Are there any other settings (buried in multi-laguage settings, maybe) that
would deeply change the way that works? (I'm not especially convinced of
this, though, since I'm testing against two different installations - one of
Word 2003 with a lot of multi-language options enabled, and one Word 2007
with pretty much a default, vanilla install, and they both behave identically
in these respects.)
Alternatively, you may be able to copy and paste (Ctrl+V) the character into
the dialog. Even if it isn't displayed correctly, the Find may work.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

That works/helps in some instances, but, as I detailed in my related
question in the thread "dealing forcefully with Unicode and non-Unicode
characters," apparently substitutions are sometimes made when exotic
characters are pasted into the Find What box. If I can't count on the Find
What box actually searching on what I give it, I can't have confidence in
what it finds, or doesn't.

Thanks for the suggestions.

da9ve
 
S

Suzanne S. Barnhill

The main tip here is that Help says ^U, but what Find actually wants is ^u.
Beyond that, I'm not sure what you're doing wrong. Are you entering the
numbers from the numeric keypad? Shouldn't matter here, but in ordinary text
(with Alt+) it does. What character are you searching for? What is its hex
number? Decimal number?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
R

Robert

Hi,
This works for me here (MS Word 2007, Windows XP SP3).
For example, "^u8220" finds opening curly quotes, "^u8221" closing curly
quotes.
Note that the "u" has to be lowercase. It does not matter whether you use
the numeric pad or not for the Unicode values. But these must be entered
with their decimal code.
"Wild Card" search has to be off.
HTH.
 
R

Robert

Also 100% consistent is that EVERY
TIME I start the search string with ^u (lower case), I only get back "Word
has finished searching the document. The search items was not found."

This message appears most of the time when people do a search, then forget
to bring the insertion point back up to the top of the document.
Maybe you forgot to bring the insertion point back up to the top of the
document after you unsuccessfully searched for ´^U8220¡ or ´^U220C¡.
HTH.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top