Java unicode

hello, I have the following code in c that I need to convert to java.
i'm just struggling converting \x001 to java.  appreciate any help. thanks

unsigned char myStr[] = {
'4', '3', '|',
'1', '|',
'2', '3', '2',  '0', '5', '3', '4', '9', '|',
'|',
'\x0f5', '\x000',
'\x001', '\x000', '4', '\x000',
'\x002', '\x000', 'R', 'i', 'c', 'k', '\x000',
'\x003', '\x000', 'H', 'i', ' ', 't', 'h', 'e', 'r', 'e', '!', '\x000',
'|'
};


appreciate any help.
h3razaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kenneth BrownResearch AssociateCommented:
Im not a java expert, but see if this helps: http://mindprod.com/jgloss/hex.html
0
h3razaAuthor Commented:
yes, i've looked at that but not sure how to do 'x001' in java.
0
wdfdo1986Commented:
try this line and see
System.Out.println('\u0D9A');
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

h3razaAuthor Commented:
but I want to send it  over a socket connection
0
h3razaAuthor Commented:
what is the difference in putting the \x and \u   c, java?
0
wdfdo1986Commented:
in java if we say \u for a character that means that character is a unicode character
i dont know much about c but
0
h3razaAuthor Commented:
the only question is how to convert the following to java. I tried adding u instead of x but eclipse complains saying there is no such unicode

'\x0f5', '\x000',
'\x001', '\x000', '4', '\x000',
'\x002', '\x000', 'R', 'i', 'c', 'k', '\x000',
'\x003', '\x000', 'H', 'i', ' ', 't', 'h', 'e', 'r', 'e', '!', '\x000',
0
wdfdo1986Commented:
try adding \u instead of \
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Try something more like this...

byte myStr[] = {
'4', '3', '|',
'1', '|',
'2', '3', '2',  '0', '5', '3', '4', '9', '|',
'|',
(byte) 0xf5, 0x00,
0x01, 0x00, '4', 0x00,
0x02, 0x00, 'R', 'i', 'c', 'k', 0x00,
0x03, 0x00, 'H', 'i', ' ', 't', 'h', 'e', 'r', 'e', '!', 0x00,
'|'
};
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.