PC Review


Reply
Thread Tools Rate Thread

Clipboard Problems with HTML

 
 
James Hancock
Guest
Posts: n/a
 
      23rd Nov 2006
I'm trying to intercept the clipboard so that I can fix Word's disasterous
HTML that comes through before pasting it into a text box. I just pull the
fragment information from the result that comes back when you ask for the
Text that's of type HTML.

Everything works just great, except when there are accents:
- è - è - ê - ë - à - â - ô - ö - î - ' - ? - ! - ;

If you paste that into word and then paste it into a text box and intercept
the clipboard I get all kinds of weird characters none of which are those
above. If I leave it alone of course it works just fine. It looks like the
Clipboard in .NET is not handling unicode right or something. I'm at a loss.
Anyone have any ideas on how I can get the clipboard of HTML code correctly?

Thanks!
James Hancock

 
Reply With Quote
 
 
 
 
ThunderMusic
Guest
Posts: n/a
 
      23rd Nov 2006
Hi,
it's probably an encoding problem... As I see it, Word must encode it's
unicode caracters in an Ansi encoding (I can be wrong)... you get this
content and edit it with your .NET app which is by default (I can be wrong
again) in UTF8, which means that special characters do not have the same
values when they are encoded in ANSI or in UTF8, so they end up all messed
up in your result... Try to use this from a .NET app to the clipboard right
back to a .NET and the problem is most likely not occuring... So try to
determine which encoding Word is using and try to encode your things using
the same encoding using the System.Text.Encoding namespace...

I hope it helps

ThunderMusic


"James Hancock" <~(E-Mail Removed)> wrote in message
news:92AC8855-38AC-4D8F-9AB4-(E-Mail Removed)...
> I'm trying to intercept the clipboard so that I can fix Word's disasterous
> HTML that comes through before pasting it into a text box. I just pull the
> fragment information from the result that comes back when you ask for the
> Text that's of type HTML.
>
> Everything works just great, except when there are accents:
> - è - è - ê - ë - à - â - ô - ö - î - ' - ? - ! - ;
>
> If you paste that into word and then paste it into a text box and
> intercept the clipboard I get all kinds of weird characters none of which
> are those above. If I leave it alone of course it works just fine. It
> looks like the Clipboard in .NET is not handling unicode right or
> something. I'm at a loss. Anyone have any ideas on how I can get the
> clipboard of HTML code correctly?
>
> Thanks!
> James Hancock



 
Reply With Quote
 
James Hancock
Guest
Posts: n/a
 
      23rd Nov 2006
That was my thought too but I can't find any documentation at all about
this, and oddly most of those characters actually come out as jsut one
character in the clipboard if read from .NET...

"ThunderMusic" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> it's probably an encoding problem... As I see it, Word must encode it's
> unicode caracters in an Ansi encoding (I can be wrong)... you get this
> content and edit it with your .NET app which is by default (I can be wrong
> again) in UTF8, which means that special characters do not have the same
> values when they are encoded in ANSI or in UTF8, so they end up all messed
> up in your result... Try to use this from a .NET app to the clipboard
> right back to a .NET and the problem is most likely not occuring... So
> try to determine which encoding Word is using and try to encode your
> things using the same encoding using the System.Text.Encoding namespace...
>
> I hope it helps
>
> ThunderMusic
>
>
> "James Hancock" <~(E-Mail Removed)> wrote in message
> news:92AC8855-38AC-4D8F-9AB4-(E-Mail Removed)...
>> I'm trying to intercept the clipboard so that I can fix Word's
>> disasterous HTML that comes through before pasting it into a text box. I
>> just pull the fragment information from the result that comes back when
>> you ask for the Text that's of type HTML.
>>
>> Everything works just great, except when there are accents:
>> - è - è - ê - ë - à - â - ô - ö - î - ' - ? - ! - ;
>>
>> If you paste that into word and then paste it into a text box and
>> intercept the clipboard I get all kinds of weird characters none of which
>> are those above. If I leave it alone of course it works just fine. It
>> looks like the Clipboard in .NET is not handling unicode right or
>> something. I'm at a loss. Anyone have any ideas on how I can get the
>> clipboard of HTML code correctly?
>>
>> Thanks!
>> James Hancock

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
Re: Character encoding problems reading Html from Clipboard Tim_Mac Microsoft Dot NET Framework Forms 0 29th Aug 2005 05:05 PM
Re: Character encoding problems reading Html from Clipboard Michael Phillips, Jr. Microsoft Dot NET Framework Forms 0 26th Aug 2005 11:04 PM
Problems with clipboard : system.runtime.interopservices : The requested clipboard operation failed Dennis Microsoft C# .NET 0 5th Apr 2004 06:43 PM
HTML to Clipboard Robert Manookian Microsoft Dot NET Framework Forms 1 11th Aug 2003 04:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:01 PM.