Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in serial port reading

 
priya pratheepp
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dears,

I am doing one program which read serial port data (for bar code reader) using java application.

My program is working well and reading serial data but it is not displaying special characters.When i read through hyperterminal i can see all special characters but when see data throught the output of java program these special characters are missing...

I don't know i am doing something wrong in stream or ???

My code is
[/code]



Please help

thanks
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The String constructor you are using expects the bytes to be in the platforms default encoding. If the application on the other end uses a different encoding, you need to specify it by using the constructor that allows the specify the encoding to use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic