• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem base64 encoding the 3 hex bytes E2 80 A9

 
Miguel Capo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I am having problems when I base64 encode a file that contains the 3 hex bytes E2 80 A9. When I decode the file I get the hex byte 3F.

Can some shed some light?

Thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us your code. What are you using to do the Base64 encoding and decoding?

(This question isn't really an Advanced Java question).
 
Miguel Capo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help,

The classes below are the ones that I am using to do the encoding and the decoding.

[ May 11, 2007: Message edited by: Jim Yingst ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you wrote your own Base64 encoder and decoder?

Is there a special reason why you wrote this yourself; why don't you use a well-tested library like Apache Jakarta Commons Codec?

If you encode and decode something and the result is different from the input, then there's obviously a bug somewhere in your code. Use a debugger to step through your code and see if it is doing what you expect it to do. You could also put System.out.println(...); statements in your code to print the value of variables at strategic places to see if the program is doing what you expect it to do.
 
Miguel Capo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advice,
I am using the Apache Jakarta Commons Codec and the problem has disappeared.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic