On Aug 18, 2008, at 07:18 , Robert Černý wrote:

Actually,I'm trying to debug some weird problems with clipboard. My problem is that data copied into clipboard from legacy java application doesn't
match data pasted into Cocoa application. I've got data with accented
characters which gets converted through MacOS Roman encoding even the visual
representation in java is correct.


If you want to print the string as hexadecimal without any conversions, you can do something like the following (keep in mind this is showing you basically the
UCS-2 version of the string):

void dumpString(NSString *str)
{
        NSUInteger len = [str length];
        unichar *chars = malloc(len * sizeof(unichar));
        [str getCharacters:chars];
        uint i;
        printf("NSString at %08p = { ", str);
        for( i = 0; i < len; i++ ) {
                if( i % 7 == 0 && i > 0 )
                        printf("\n                         ");
                printf("0x%04X ", chars[i]);
        }
        printf(" }\n");
        free(chars);
}

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to