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
Fifteen Stars TRF
Fifteen 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
Fifteen Stars TRF
Fifteen Stars

Re: problem special characters

Great!

Thank's to mark your case as solved.


TRF

All Replies
Fifteen Stars TRF
Fifteen 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

Fifteen Stars TRF
Fifteen 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

Highlighted
Fifteen Stars TRF
Fifteen 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

Fifteen Stars TRF
Fifteen 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]", "");
 
 
 
Fifteen Stars TRF
Fifteen Stars

Re: problem special characters

Great!

Thank's to mark your case as solved.


TRF

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download