Bug report #4844
Multiline Labels - handling of Carriage Return / Line Feed characters
|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).
#3 Updated by Brian Freed over 7 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!