0

Possible Duplicate:
Replacing unicode punctuation with ASCII approximations

I think I can totally blame Microsoft for this, but I have some string stored in my database and they have these dashes and quotes that aren't the normal dashes and quotes. I think they're trying to be smart or something...

It is displaying on the page just fine, but I need to send it as ASCII to a different program.

I have looked at this question Convert Unicode to ASCII without changing the string length (in Java), and specifically @Denis Tulskiy answer, but it turns the fancy dashes into question marks instead of normal dashes. How do I modify it to work on those few characters?

Community
  • 1
  • 1
Mikey
  • 4,692
  • 10
  • 45
  • 73

1 Answers1

0

Just replace these fancy characters with ones you find more appropriate and which have a representation in ASCII. Finally call String.getBytes("ASCII") to get the desired encoding.

Arne
  • 2,106
  • 12
  • 9