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

View solution in original post

Sixteen Stars TRF
Sixteen Stars

Re: problem special characters

Great!

Thank's to mark your case as solved.


TRF

View solution in original post


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

Sixteen Stars TRF
Sixteen Stars

Re: problem special characters

OK but what about your input ?


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

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

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

View solution in original post

Six Stars

Re: problem special characters

Yes, Thanks TRF, just i used this code:

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

Re: problem special characters

Great!

Thank's to mark your case as solved.


TRF

View solution in original post

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog