problem special characters

Six Stars

problem special characters

Hello,

i have a problem in display of XML File, problem of special characters.

when i open the file with a editor xml, i got like two points :

 

 Capture_XMLCopy.JPG

and when i open the file with mozilla firefox, i got a special character :

CaptureFirefox.JPG

 

And when i use tlogRow to display data in talend, i got empty space:

CaptureLOg.JPG

 

I didn't understand this display difference and why in the mozilla firefox, i got this special caractere, it's not good when i display data in web (i want to remove this special caractere in mozilla)

I tried to use tReplace to remove the two point (..) / (¨) but i got nothing, i got the same result.

 

Thanks

Reda


Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: problem special characters

You can try to remove all non-ascii char from your string:

row1.fieldName.replaceAll("[^\x0A\x0D\x20-\x7E]", "")

(not tested)

 


TRF
Forteen Stars TRF
Forteen Stars

Re: problem special characters

Great!

Thank's to mark your case as solved.


TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: problem special characters

Hi,

Are you usin tFileInputXML component?

If so, try to define Encoding as UTF-8 on Advanced Setting tab.


TRF
Six Stars

Re: problem special characters

 I use tAdvancedFileOutoutXML and i tried to use all encoding but the always i got the same result

Forteen Stars TRF
Forteen Stars

Re: problem special characters

OK but what about your input ?


TRF
Six Stars

Re: problem special characters

My input is a Data from database, i give you three display by using tAdvancedfileoutputXML (fireffox and XMLCopy Editor) and tLogrow.

When i execute the my requete sql in hybris i got like this ( big point )

CaptureHYB.JPG

Forteen Stars TRF
Forteen Stars

Re: problem special characters

It seems the special character is in your input.

Try to display ascii code for each character, this will give you the answer for "which character must be removed to clean the output".


TRF
Six Stars

Re: problem special characters

The code ascii is 149,  it correspond à "ò", i use treplace but always without success.

Capture_ASCII.JPG

Forteen Stars TRF
Forteen Stars

Re: problem special characters

You can try to remove all non-ascii char from your string:

row1.fieldName.replaceAll("[^\x0A\x0D\x20-\x7E]", "")

(not tested)

 


TRF
Six Stars

Re: problem special characters

Yes, Thanks TRF, just i used this code:

replaceAll("[^\\x00-\\x7F]", "");
 
 
 
Forteen Stars TRF
Forteen Stars

Re: problem special characters

Great!

Thank's to mark your case as solved.


TRF