VirtualBox

Changeset 8268

Show
Ignore:
Timestamp:
04/22/08 11:12:54 (9 months ago)
Author:
vboxsync
Message:

OSX: Fixed #2788. Utf-16 text not transfered from host to guest.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/HostServices/SharedClipboard/clipboard-helper.cpp

    r8155 r8268  
    5050    for (i = (pwszSrc[0] == UTF16LEMARKER ? 1 : 0); i < cwSrc; ++i, ++cwDest) 
    5151    { 
     52        /* Check for a single line feed */ 
    5253        if (pwszSrc[i] == LINEFEED) 
     54            ++cwDest; 
     55        /* Check for a single carriage return (MacOS) */ 
     56        if (pwszSrc[i] == CARRIAGERETURN) 
    5357            ++cwDest; 
    5458        if (pwszSrc[i] == 0) 
     
    113117            } 
    114118        } 
     119        else 
     120            /* Check for a single carriage return (MacOS) */ 
     121            if (pwszSrc[i] == CARRIAGERETURN) 
     122            { 
     123                /* set cr */ 
     124                pu16Dest[j] = CARRIAGERETURN; 
     125                ++j; 
     126                if (j == cwDest) 
     127                { 
     128                    LogFlowFunc(("returning VERR_BUFFER_OVERFLOW\n")); 
     129                    return VERR_BUFFER_OVERFLOW; 
     130                } 
     131                /* add the lf */ 
     132                pu16Dest[j] = LINEFEED; 
     133                continue; 
     134            } 
    115135        pu16Dest[j] = pwszSrc[i]; 
    116136    } 
  • trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp

    r8155 r8268  
    167167            CFDataRef outData; 
    168168            PRTUTF16 pwszTmp = NULL; 
    169             /* Utf-16 is currently broken on more than one line. 
    170              * Has to be investigated. */ 
    171 #if 0 
    172169            /* Try utf-16 first */ 
    173170            if (!(err = PasteboardCopyItemFlavorData (pPasteboard, itemID, CFSTR ("public.utf16-plain-text"), &outData))) 
     
    178175            /* Second try is utf-8 */ 
    179176            else 
    180 #endif 
    181177                if (!(err = PasteboardCopyItemFlavorData (pPasteboard, itemID, CFSTR ("public.utf8-plain-text"), &outData))) 
    182178                { 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy