Jump to content

Bullets and RegEx fun


strido

Recommended Posts

Many times in the past I've had issues with this character or that displaying improperly. For some reason I can't get through it this time. I'm hoping someone may be able to see something in this code that I'm missing.

 

Here's the deal:

The client is accessing a web portal, and when there, they're choosing one or several bullet points that will eventually populate on their PDF. When I compose the PDF on my desktop the bullets populate correctly. When I process it through the server, not so much. I'm getting the following characters instead of the bullet:

 

•

 

I've been trying to use some regular expressions and / or replacing to accomodate those. Replacing the offending characters with an empty space. I've tried to replace them with the actual bullet as well.

 

The rule below is what I'm trying to get working. Commenting out the "ReplaceSubstring" lines and uncommenting the RegExp lines gives identical results.

 

lcFieldContent = Field("Bullet_Points")

return ReplaceSubstring(lcFieldContent,"•", "<br> •")

var rval = ReplaceSubstring(lcFieldContent,"â","");

var rval = ReplaceSubstring(lcFieldContent,"€","");

var rval = ReplaceSubstring(lcFieldContent,"¢","");

//rval = rval.replace( new RegExp("\u00E2","gm"),"");

//rval = rval.replace( new RegExp("\u20AC","gm"),"");

//rval = rval.replace( new RegExp("\u00A2","gm"),"");

 

return rval

 

There's got to be something in there I'm missing. Curiously, if I change the 2nd line to ReplaceSubstring(lcFieldContent,"•", "<br> /u2022") the bullet becomes something of a double-quotation mark, even thouh /u2022 is for the bullet.

 

Strange.

Link to comment
Share on other sites

Bonus points!

 

http://i136.photobucket.com/albums/q195/strido527/Capture_zps701f054e.jpg

 

 

See how the word "plan" wraps underneath the bullet (or where it'll be when the above is fixed)? Originally their hope was to have it indented to start under the word "Provide" - how would we accomodate that? We can't (that I know of) include paragraph styles on the variable data. All the bullet points would basically be inside of one cell in the data source.

Link to comment
Share on other sites

Many times in the past I've had issues with this character or that displaying improperly. For some reason I can't get through it this time. I'm hoping someone may be able to see something in this code that I'm missing.

 

Here's the deal:

The client is accessing a web portal, and when there, they're choosing one or several bullet points that will eventually populate on their PDF. When I compose the PDF on my desktop the bullets populate correctly. When I process it through the server, not so much. I'm getting the following characters instead of the bullet:

 

•

 

I've been trying to use some regular expressions and / or replacing to accomodate those. Replacing the offending characters with an empty space. I've tried to replace them with the actual bullet as well.

 

The rule below is what I'm trying to get working. Commenting out the "ReplaceSubstring" lines and uncommenting the RegExp lines gives identical results.

 

 

 

There's got to be something in there I'm missing. Curiously, if I change the 2nd line to ReplaceSubstring(lcFieldContent,"•", "<br> /u2022") the bullet becomes something of a double-quotation mark, even thouh /u2022 is for the bullet.

 

Strange.

If you want to output UTF-16 Unicode characters (with code points greater than 255), you need to make sure that the "Limit processing to Latin-1 text" box on the Advanced tab of the Composition Settings dialog is unchecked.

 

But your issue is probably in the data file that's being generated by the web application. It's probably UTF-8. So you might be able to fix it by specifying UTF-8 encoding in the Data Source Wizard. But if the web app is generating a tagged markup data file, the only fix is to make sure that the web app is properly marking the data file with an appropriate byte order mark.

 

What web portal exactly are you using here? MarcomCentral? DSF? Something else?

Bonus points!

 

http://i136.photobucket.com/albums/q195/strido527/Capture_zps701f054e.jpg

 

 

See how the word "plan" wraps underneath the bullet (or where it'll be when the above is fixed)? Originally their hope was to have it indented to start under the word "Provide" - how would we accomodate that? We can't (that I know of) include paragraph styles on the variable data. All the bullet points would basically be inside of one cell in the data source.

Set the left indent for the paragraph in the Paragraph Formatting dialog. Or prepend a tag such as <p br="false" lindent="3600">.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...