LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2009, 01:41 AM   #1
naveenisback
Member
 
Registered: Jun 2009
Posts: 80
Blog Entries: 1

Rep: Reputation: 16
the problem in wide character string receiving


Hi frenz,


Im doing client server program. in which client is running in a linux machine and server running in windows machine. the data type of send_buffer and receive_buffer is wchar_t. I receive an xml message from windows(server) like this...

<^@?^@x^@m^@l^@ ^@v^@e^@r^@s^@i^@o^@n^@=^@"^@1^@.^@0^@"^@?^@>^@^M^@
^@<^@S^@y^@s^@t^@e^@m^@i^@n^@f^@o^@>^@^M^@
^@ ^@<^@C^@P^@U^@I^@n^@f^@o^@>^@^M^@
^@ ^@ ^@^M^@
^@ ^@ ^@<^@P^@r^@o^@c^@e^@s^@s^@o^@r^@_^@N^@a^@m^@e^@>^@I^@n^@t^@e^@l^@(^@R^@)^@ ^@P^@e^@n^@t^@i^@u^@m^@(^@R^@)^@
^@D^@u^@a^@l^@ ^@ ^@C^@P^@U^@ ^@ ^@E^@2^@1^@8^@0^@ ^@ ^@@^@ ^@2^@.^@0^@0^@G^@H^@z^@<^@/^@P^@r^@o^@c^@e^@s^@s^@o^@r^@_^@N^@a^
@m^@e^@>^@^M^@
^@ ^@ ^@<^@N^@o^@_^@o^@f^@_^@P^@r^@o^@c^@e^@s^@s^@o^@r^@s^@>^@2^@<^@/^@N^@o^@_^@o^@f^@_^@P^@r^@o^@c^@e^@s^@s^@o^@r
^@s^@>^@^M^@
^@ ^@ ^@<^@P^@r^@o^@c^@e^@s^@s^@o^@r^@_^@C^@u^@r^@r^@e^@n^@t^@S^@p^@e^@e^@d^@>^@1^@1^@9^@9^@ ^@M^@H^@z^@<^@/^@P^@r
^@o^@c^@e^@s^@s^@o^@r^@_^@C^@u^@r^@r^@e^@n^@t^@S^@p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@ ^@2
^@0^@0^@3^@,^@ ^@E^@n^@t^@e^@r^@p^@r^@i^@s^@e^@ ^@E^@d^@i^@t^@i^@o^@n^@<^@/^@O^@S^@>^@^M^@
^@ ^@ ^@<^@S^@e^@r^@v^@i^@c^@e^@P^@a^@c^@k^@>^@S^@e^@r^@v^@i^@c^@e^@ ^@P^@a^@c^@k^@ ^@2^@<^@/^@S^@e^@r^@v^@i^@c^@e
^@P^@a^@c^@k^@>^@^M^@
^@ ^@ ^@<^@B^@u^@i^@l^@d^@N^@o^@>^@3^@7^@9^@0^@<^@/^@B^@u^@i^@l^@d^@N^@o^@>^@^M^@
@
@
@
@

why it is happening like this.. after receiving I have to validate xml element objects.

can i parse this message with xml parsing.

i dont want shell script or commands. pls where can i find parsing program.
help me pls.
 
Old 07-07-2009, 09:06 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 77
You are mixing UTF-16 and UTF-8 characters. Make sure to serialize correctly across locales. For a quick fix, try “iconv -f UTF-16 -t UTF-8”.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ncurses wide character/extended ASCII problem Hosiah Programming 3 03-03-2009 12:55 PM
Samba/Kerberos : ads_connect: Invalid or incomplete multibyte or wide character Lordandmaker Linux - Networking 0 04-01-2008 05:03 AM
help: wide character ?inconsistencies? maxreason Fedora 3 01-29-2008 11:44 PM
about wide character and multiple byte character George2 Programming 5 05-23-2006 01:03 AM
Invalid or incomplete multibyte or wide character chanys Linux - General 1 03-13-2003 10:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration