Re: get_innerHTML on body returns ? characters for UNICODE text
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Fri, 9 Sep 2005 10:53:46 -0400
Craig Swearingen <swearing@xxxxxxxxxx> wrote:
> 1) When I use IHTMLElement::get_innerHTML on a BODY element I can get
> back the HTML and text but if it has UNICODE text within it I see '?'
> characters for it instead of UNICODE character references like
> '每' for each character.
get_innerHTML returns a Unicode string. There is no need to escape those
characters with character entities, they are just being represented
directly as Unicode codepoints. Now, whatever it is you are using to
view the content clearly does not support rendering those characters,
that's why you see question marks.
> IHTMLTxtRange::get_htmlText has the
> same problem. How can I tell it that I want the UNICODE character
> references too?
You can't. If you want that, you need to post-process the string and
replace all Unicode codepoints you deem "unsafe" with character
references.
> 2) If I do a save using a IPersistStreamInit I get what I expect for
> UNICODE text too.
This method gives you the data exactly as sent by the server, with no
processing at all. Among other things, this means that it is not
necessarily Unicode text - the server could send the content in some
legacy encoding.
> However, this method doesn't notice changes if
> you've been editing. Is there a way to submit the changes such that
> the stream will be the current state before I get a copy of it?
None that I know of.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: get_innerHTML on body returns ? characters for UNICODE text
- From: Craig Swearingen
- Re: get_innerHTML on body returns ? characters for UNICODE text
- References:
- get_innerHTML on body returns ? characters for UNICODE text
- From: Craig Swearingen
- get_innerHTML on body returns ? characters for UNICODE text
- Prev by Date: get_innerHTML on body returns ? characters for UNICODE text
- Next by Date: Re: get_innerHTML on body returns ? characters for UNICODE text
- Previous by thread: get_innerHTML on body returns ? characters for UNICODE text
- Next by thread: Re: get_innerHTML on body returns ? characters for UNICODE text
- Index(es):
Relevant Pages
|
|