Please enable JavaScript to view this site.

InterFormNG Manual 2020

Navigation: Getting started > Troubleshooting

Replace non-breakable space with a normal space

Scroll Prev Top Next More

If you have found, that you sometimes get an non-breakable space in the input data, then you should consider to activate the related option (NBSP) in the general system settings.

 

If you however are running an older version of InterFormNG, where this option is not found, then you can also prevent an error by replacing any non-breakable spaces in a field with a normal space.

 

The only way to verify, if this is a problem is to look at the contents of the input file in a hex editor:

 

NG1NonBreakableSpace0001

 

Such a solution is shown below:

 

Problem:

In some input files we might get the non.-breakable space (hexadecimal C2A0) in a specific input field.

 

Solution:

Scan replace any C2A0 characters with a normal space.

 

In order to implement a solution we first need to define a variable, that contains this special character. One way to do that is to define a variable like this in the start of our template:

 

NG1NonBreakableSpace0002

 

In the bottom we have told InterFormNG, that the text is actual hexadecimal characters.

 

 

Now we can search a node from the input file and replace (or rather translate) any occurrence of this character into a normal space. That can e.g. be done in a text element (or barcode element) like so:

 

NG1NonBreakableSpace0003

 

The xpath function is this: replace(InputField,'{@nbsp}',' ') (if you want to copy it as text). This function converts the node called InputField in the way explained above.