Bug report #4844

Multiline Labels - handling of Carriage Return / Line Feed characters

Added by Brian Freed over 12 years ago. Updated over 10 years ago.

Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:14681


Windows XP, Spatialite database layers

I have some spatial views using group_concat, which I want to show up in QGIS as multiline labels, with each item on its own line.
So I define group_concat(a,';
to use a semicolon, new line combination.

The result is pretty much what I want, but with a square box at the end of each line except the last. I finally figured it out - Notepad++ (or Windows notepad too) inserts both a Carriage Return & a Line Feed when you hit enter in the editor. QGIS is using the LF to split the multiline labels correctly, but is displaying the CR as the boxed character.

There's a workaround - in Notepad++, you can view all characters, and turn on the ASCII Insertion Panel, and define the view with ONLY a LF and no CR, and then everything is great.

But it'd be nice if QGIS could recognize the CR|LF combination, since that seems to be the default for Windows' most common text editors (I can't speak to any other OS/editor combo).


#1 Updated by Nathan Woodrow over 12 years ago

Can you see if the latest build of QGIS, which allows you to define a string to wrap on, can handle this. If you go to the Advanced tab in the label settings and set the "Wrap label on character" to \

See if that works.

#2 Updated by Paolo Cavallini almost 12 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#3 Updated by Brian Freed almost 12 years ago

Shoot, sorry Nathan, I forgot this one was still floating out there. The new labeling in 1.8 is fantastic. In terms of our company's use, this 'issue' is now irrelevant. Not only because of the 'wrap on character' feature, but also because being able to concatenate multiple columns in labeling means I don't have to build views with columns specifically for QGIS labels.

So old way: View definition: Column "QGIS Label" = A || '[line feed]' || B

new way: no "QGIS Label" column - in QGIS, set label as A || '/' || B, then set to wrap on '/'.

As far as I'm concerned, this is no longer an issue. Thanks!

#4 Updated by Larry Shaffer about 11 years ago

  • Status changed from Open to Resolved

#5 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF