mspocketpc.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dealing with charset between different applications (Java/C+

 
Post new topic   Reply to topic    mspocketpc.org Forum Index -> Developers
Author Message
Christian



Joined: 30 Jan 2008
Posts: 9

PostPosted: Tue Feb 19, 2008 8:15 am    Post subject: Dealing with charset between different applications (Java/C+ Reply with quote

Hi,
I have some doubts and I hope you can dissolve them.
I'm using as my target machine a Pocket PC with Windows Mobile SE
2003. I have a client written in Java and a server written in C++. I
have to send characters such as è,ò,à and so on. I suppose that if I
send from java application such characters and I receive them in a
char array,they'll be misunderstood right?
The charset in use on the Pocket PC is ISO8859_1 (discovered through
java application). If I send bytes with this encoding,how can I deal
them? wchar_t?
And how I send responses to the client? send is defined as:

send(
IN SOCKET s,
IN const char FAR * buf,
IN int len,
IN int flags
);

which it doesn't use wchar_t. Please give me some advices.
Thanks

Archived from group: microsoft>public>pocketpc>developer
Back to top
View user's profile Send private message
user



Joined: 15 Aug 2007
Posts: 459

PostPosted: Tue Feb 19, 2008 12:33 pm    Post subject: Re: Dealing with charset between different applications (Jav Reply with quote

As long as the sender and the receiver use the same charset (and they will
be) then there's no problem. A socket sends a stream of bytes. It could be
ascii chars, wchars, image data or anything you want. As long as the sender
and receiver are using the same thing it will work fine.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com



"Christian" wrote in message @o77g2000hsf.googlegroups.com...
Hi,
I have some doubts and I hope you can dissolve them.
I'm using as my target machine a Pocket PC with Windows Mobile SE
2003. I have a client written in Java and a server written in C++. I
have to send characters such as è,ò,à and so on. I suppose that if I
send from java application such characters and I receive them in a
char array,they'll be misunderstood right?
The charset in use on the Pocket PC is ISO8859_1 (discovered through
java application). If I send bytes with this encoding,how can I deal
them? wchar_t?
And how I send responses to the client? send is defined as:

send(
IN SOCKET s,
IN const char FAR * buf,
IN int len,
IN int flags
);

which it doesn't use wchar_t. Please give me some advices.
Thanks
Back to top
View user's profile Send private message
Christian



Joined: 30 Jan 2008
Posts: 9

PostPosted: Wed Feb 20, 2008 6:43 am    Post subject: Re: Dealing with charset between different applications (Jav Reply with quote

On Feb 19, 2:33 pm, "" wrote:
> As long as the sender and the receiver use the same charset (and they will
> be) then there's no problem. A socket sends a stream of bytes. It could be
> ascii chars, wchars, image data or anything you want. As long as the sender
> and receiver are using the same thing it will work fine.

That's clear....
1) But how can I use ISO8859_1 charset in C++?
2) when I define a charr sequence,what's the default charset? And if I
define a wchar sequence?

Thanks.
Back to top
View user's profile Send private message
user



Joined: 15 Aug 2007
Posts: 459

PostPosted: Wed Feb 20, 2008 10:07 am    Post subject: Re: Dealing with charset between different applications (Jav Reply with quote

Just use wchar_t or TCHAR.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


"Christian" wrote in message @e60g2000hsh.googlegroups.com...
> On Feb 19, 2:33 pm, "" wrote:
>> As long as the sender and the receiver use the same charset (and they
>> will
>> be) then there's no problem. A socket sends a stream of bytes. It could
>> be
>> ascii chars, wchars, image data or anything you want. As long as the
>> sender
>> and receiver are using the same thing it will work fine.
>
> That's clear....
> 1) But how can I use ISO8859_1 charset in C++?
> 2) when I define a charr sequence,what's the default charset? And if I
> define a wchar sequence?
>
> Thanks.
>
Back to top
View user's profile Send private message
r_z_aret



Joined: 15 Aug 2007
Posts: 2774

PostPosted: Wed Feb 20, 2008 8:25 pm    Post subject: Re: Dealing with charset between different applications (Jav Reply with quote

On Wed, 20 Feb 2008 05:07:48 -0600, ""
wrote:

>Just use wchar_t or TCHAR.

These are equivalent if and only if UNICODE is defined for the build.
Which is always true when building for Windows CE and platforms built
on it. But mixing the two can cause nasty problems if the source code
is ever compiled with UNICODE not defined.

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Dealing with crashing application Hi, I have a server application which waits for connection on function "accept". When I start debugging (and Pocket PC emulator load my application) if I close the emulator the server crash with code 1067 (0x42b). I tried to put this function in a try/cat

MAPI IMessage and charset Is there any way to set charset for outgoing message? All outgoing messages created use ISO-8859-1, but I need to change this. Using default mail application it is possible to change charset, but how to do it when we send message programm

Java I have a quick question. I want to know if Pocket PC 2003 will support Java. If not does anyone know how to convert a java program to work with Pocket PC?

Java script on Windows Mobile 6.0 Hello All, We are facing some issues related to Java Script on Windows Mobile 6.0. It looks like JScript is disabled by default on Windows Mobile 6.0 (tested on Emulator). Is there any way to enable it? Same Java Script code used to work on PPC 2003 and W

Can the VRML or JAVA 3D achieve the goal of displaing a 3D o Hello, I want to display a HTML page with a 3D objecton on a mobile 5 device? Can the VRML or JAVA 3D achieve the goal? Or, I need use another technology? Many thanks. Joye Liu
Post new topic   Reply to topic    mspocketpc.org Forum Index -> Developers All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group