That's a pretty important part of the story, and makes the situation very different. It also makes the interviewer seem a lot more competent. Trivia questions are useless in interviews, and the fact that you were able to quickly google it, recognize it as a relevant solution, and apply it correctly actually is demonstrating that you know how to learn things quickly (and that you have at least some familiarity with binary representations and manipulations). The average charlatan would just start copying and pasting in panic, which is usually pretty easy to pick up on.
Meanwhile, you can't pretend what you described in your post is really a moral position if you had not said anything. It might not have been strictly immoral as you really owe them nothing, but there's no shining principle demonstrated there.
If I asked you a question about manipulating Unicode, I am so obviously not looking to find out how quickly you learn things, and you know perfectly well I'm not. I'm finding out what you know about character encoding and string manipulation!
(Regarding your addendum, if you're actually honest about it in the interview I don't really take any issue with it. But I hope you would be honest about it before an interviewer has to ask you whether you cheated.)
Interviewing is different from a real job. You need to show you can do more than look up solutions on the web.
I can't blame you for trying to cheat your way into a job and I certainly blame the interviewer for not seeing through your cheat, but make no mistake: you cheated.
in this instance that is absolutely not cheating.
My word of advice to you is this: study harder next time, be honest when they hit a gap in your knowledge (maybe they will offer to fill in that gap!), and don't Google on the phone. Interviews are like tests at school - closed book, unless stated otherwise.
Software engineers are given problems to solve, and their job is to solve these problems efficiently. You don't always have the solution to every problem off of the top of your head. That's why programmers use Google, StackOverflow, and documentation as resources. The primary skill employers are looking for is learning how to learn new things quickly. And I believe I demonstrated that skill in my interview.
Also, I declined to mention this in the article, but after I finished that UTF encoding problem in my interview, the interviewer asked where I got the check-bit macro (he saw me paste it in). I told him I got it from StackOverflow. It didn't seem to concern him.