Re: SetClipBoard returns Junk characters!

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:tjcu84dhbf3me1090c257bo8pf4h66onba@xxxxxxxxxx
...as it is documented to do.

How does Windows know which code page to use when converting from ANSI ->
UNICODE? It is a 1:many mapping. If the wrong Unicode characters are being
stored in the clipboard, obviously something is wrong. The solution is for
the OP to use CStringW to explicitly create a wide (Unicode) string from the
Ansi and put that into the clipboard using CF_UNICODETEXT. As you say, this
downconverts to CF_TEXT but cannot guarantee correct results due to loss of
precision.

-- David


.



Relevant Pages

  • Re: Call C DLL from VB.net-problem..array gains 4 bytes!
    ... No, Unicode strings don't, by definition, have a header with the size. ... you're writing code in C++, for example, the only difference between an ANSI ... which take an array of bytes. ... > Remember the DLL declaration... ...
    (microsoft.public.windowsce.app.development)
  • Re: A (mild-mannered) defense of RosAsm Rocks !!!
    ... All functions that have a Unicode ... and ANSI implementation are Unicode first, ... this API is not available in Win9x without the ... Oh by the way the Coward is the asshole that wrote the peice of garbage ...
    (alt.lang.asm)
  • Re: Delphi 2009/2010 ohne Unicode?
    ... Wenn Eingabe und Ausgabe ANSI ist, ... dann möchte ich in Bauch nicht mit Unicode ... arbeiten da zum einen die Eingangskonvertierung ... Zeichen in UTF-16 keine Surrogate-Pairs benötigen. ...
    (de.comp.lang.delphi.misc)
  • Re: Error 52 Bad file name or number on file read
    ... Sorry Nick but if you're ending up with a mixture of ANSI and Unicode data ... Private Type FILETIME ... Public Function StripNulls(sText As String) As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Unicode character in non-unicode text file
    ... > I'm trying to reproduce the capabilities in both Notepad and Excel, ... > a Unicode text file with Unicode characters can be converted to ANSI, ... Question 1: "what ANSI" ...
    (microsoft.public.dotnet.general)