An open API service indexing awesome lists of open source software.

https://github.com/bjansen/sepa-conversion-tool

A Java library that implements the SEPA conversion table provided by the EPC
https://github.com/bjansen/sepa-conversion-tool

charset-conversion converter converter-library sepa

Last synced: 3 months ago
JSON representation

A Java library that implements the SEPA conversion table provided by the EPC

Awesome Lists containing this project

README

        

# sepa-conversion-tool ![](https://img.shields.io/maven-central/v/com.github.bjansen/sepa-conversion-tool.svg?style=flat)
A Java library that implements the [SEPA conversion table](https://www.europeanpaymentscouncil.eu/document-library/guidance-documents/sepa-requirements-extended-character-set-unicode-subset-best)
provided by the [EPC](https://www.europeanpaymentscouncil.eu/)

## Example

```java
@Test
void convertSample() {
SepaCharacterConverter converter = SepaCharacterConverter.basicLatin();

// characters that don't need conversion are preserved
assertEquals("hello", converter.convertToSepaCharacters("hello"));

// characters that need conversion are replaced
assertEquals("Hello", converter.convertToSepaCharacters("Ħĕŀŀœ"));

// characters that are outside of the range of the convertion table are dropped
assertEquals("outside of range", converter.convertToSepaCharacters("outsi�de o�f r≧an∰g℗e"));
}

```

## Usage

The library can be imported to Maven projects like this:

```xml

com.github.bjansen
sepa-conversion-tool
0.2.0

```

The next step is to choose your converter, and use it:

```java
SepaCharacterConverter converter = SepaCharacterConverter.basicLatin();
// or SepaCharacterConverter.longTermSepa()

String converted = converter.convertToSepaCharacters("Ħĕŀŀœ"); // will be converted to "Hello"
```