Reputation: 109
i have star micronics tsp650 and im implementing SDK in my app, but i cant print the € symbol
someone knows what is the code to print it?
Thanks
Upvotes: 2
Views: 1388
Reputation: 109
Finally STAR MICRONICS support answer me
the code to print € symbol is
[commands appendBytes:"\x1b\x1d\x74\x04"
length:sizeof("\x1b\x1d\x74\x04")-1]; //meto Euro
[commands appendBytes:"\xD5"
length:sizeof("\xD5")-1]; //meto euro
Upvotes: 2
Reputation: 112855
€ in hex byte values:
UTF16: 20AC
UTF8: E2 82 AC
char utf8[] = "\xE2\x82\xac";
char utf16[] = "\x20\xAC";
NSLog(@"utf8: %@", [[NSString alloc] initWithBytes:utf8 length:3 encoding:NSUTF8StringEncoding]);
NSLog(@"utf16: %@", [[NSString alloc] initWithBytes:utf16 length:2 encoding:NSUTF16BigEndianStringEncoding]);
NSString *cost = @"156.95 \xE2\x82\xac\r\n"; // dataUsingEncoding:NSUTF8StringEncoding]];
NSLog(@"Cost: %@", cost);
NSMutableData *commands = [NSMutableData new];
[commands appendData:[@"156.95 \xE2\x82\xac\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
NSLog(@"commands: %@", commands);
NSLog output:
utf8: €
utf16: €
cost: 156.95 €
commands: <3135362e 393520e2 82ac0d0a>
Upvotes: 0