<p>We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit</p>

<p>So now we'll need to translate all European characters to the nearest US-Ascii. Is there any Java libraries to help with this task?</p>

<p>Right now we've just started adding to a translation table, where Å (swedish AA)->A and so on and where we don't find any match for an entered character, we'll log it and replace with a question mark and try and fix that for the next release, but it seems very inefficient and somebody else must have done something similair before.</p>

There are some built in functions to do this. The main class involved is
```
CharsetEncoder
```
, which is part of the
```
nio
```
package. A simpler way is
```
String.getBytes(Charset)
```
that can be sent to a
```
ByteArrayOutputStream
```
.