Project

General

Profile

Actions

Bug #1242

closed

WApplication::setTitle double quotes text

Added by Kurt Roeckx over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/16/2012
Due date:
% Done:

0%

Estimated time:

Description

Hi,

When I pass a string containing & to setTitle(), it ends up as & in the title.

Kurt


Files

hello.html (2.25 KB) hello.html Kurt Roeckx, 04/19/2012 02:02 AM
Actions #1

Updated by Kurt Roeckx over 13 years ago

addMetaHeader() has the same effect

Kurt

Actions #2

Updated by Wim Dumon over 13 years ago

  • Status changed from New to Feedback

Kurt,

I've modified hello.C to read:

setTitle("Hello & world");

and that works as expected, i.e. the title shows

Hello & world

That's how it should work (setTitle() is not a function that you can pass XHTML to).

If you see something different, what version of Wt are you using? Which browser?

Wim.

Actions #3

Updated by Kurt Roeckx over 13 years ago

Wim Dumon wrote:

Kurt,

I've modified hello.C to read:

[...]

and that works as expected, i.e. the title shows

[...]

That's how it should work (setTitle() is not a function that you can pass XHTML to).

If you see something different, what version of Wt are you using? Which browser?

So I tried exactly the same, and the generate html has "Hello & world", and so the browser window title shows "Hello & world" while I was expecting "Hello & world"

I'm testing this in wt 3.2.1, I don't think the browser is relevant. I've attached the output html file.

Actions #4

Updated by Wim Dumon over 13 years ago

Hello Kurt,

The output you see is what I have seen and what is expected. setTitle() does not expect XML, so it will properly escape all symbols that need to be escaped to make your text render correctly (&, <, >, ...).

If you want to see "Hello & World" as title, you'll need to render your XML string to a plain string. As far as I know, Wt does not include a method to do so.

Wim.

Actions #5

Updated by Koen Deforche over 13 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF