• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with dot-matrix printing

 
Hugh Lloyd
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, wasn't too sure if i was meant to post this here or beginners, but here's the problem anyway:

I've written a program that prints out names onto 0.9cmx5cm labels on a dot matrix printer. it works... on the whole, but after i started to really test it i noticed that some characters didn't come out right. the main one is ü (u with 2dots above it) it comes out as ⁿ (small n). I've tried making a character variable as 0252 and 0x81 and 0xFC but it either comes out as the little n or a ? when printer out. I've also tried various ESC codes for the printer (Epson lq-300+II) to allow ASCII codes after 128 to be characters but nothing. It wouldn't be that bad but the old program (written in vb 1.0) has no problem with the characters. i'll paste some code as an example of how i try to print them out.



any idea's?
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What charset is the printer expecting?

You'll have to look at the printer's documentation to see what code point it expects to receive for the ü character, for a start. Then you'll need to find out which Java charset represents the ü character by that code point. Finally, use a PrintWriter instead of a PrintStream so you can specify the charset. Right now your PrintStream is using your system's default charset, which apparently isn't the right choice.
 
Hugh Lloyd
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! that solved it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic