Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Space like Character not converted by UTF-8 to ISO-8859

I have managed to convert my files from UTF-8 to ISO-8859, but I have discovered a character of 160 between the name and surname of all the names.
I tried to use Ereplace with Char(160) but it complained saying it was a not a string.
Whats the best way to replace non-printable Asciis in strings as I should really do this across all rows.
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sorry thats what you told me.
The method is still the same but with a different parameter:
This is the syntax of the unicode replacement in Java:
(\u)(u)*(HexDigit)(HexDigit)(HexDigit)(HexDigit)

For your case:
row2.Player.replace('\u00A0', ' ').replace('\uC2A0', ' ')

I am not fully sure about the byte order so you should try it - best way in a small test java project.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

you can use the replace method of the String class.
Use this expression in the tMap
row1.name.replace('\u0160', ' ')
Anonymous
Not applicable
Author

Unfortunately it didnt work.
I thought I had better explain this better.I have put all the data in hex format to show the issues more clearly
I start off with a UTF-8 file which contains c2 a0
0683p000009MCOp.png
I run the UTF-8 to ISO-8859 conversion in Talend and it gives me this

0683p000009MCKj.pngi.e just leaving me a0
So I then tried this
row2.Player.replace('\u0160', ' ') 
But the output file still shows this

0683p000009MCHh.png
Anonymous
Not applicable
Author

Sorry thats what you told me.
The method is still the same but with a different parameter:
This is the syntax of the unicode replacement in Java:
(\u)(u)*(HexDigit)(HexDigit)(HexDigit)(HexDigit)

For your case:
row2.Player.replace('\u00A0', ' ').replace('\uC2A0', ' ')

I am not fully sure about the byte order so you should try it - best way in a small test java project.
Anonymous
Not applicable
Author

Wunderbar! Mit  row2.Player.replace('\u00A0', ' ') es hat geklappt! Vielen dank