Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11316 closed defect (wontfix)

Characters are not displayed and the widget doesn't render correctly

Reported by: Enrique Rafael Muñoz Flores Owned by: anonymous
Priority: high Milestone: tbd
Component: General Version: 1.5.0b2
Keywords: Cc:
Blocked By: Blocking:

Description

Time Text Box

Steps to reproduce:

  1. Enter any of the following characters in timePattern:

\ (backslash) Ç à â Å (U+0041 U+030A) é (U+0065 U+0301)

  1. Reload the page

Expected result: characters are displayed correctly. Actual result: None of the characters listed above are displayed. The TimeTextBox? displays the 'T' before the time and the drop down list is not displayed.

Here is the HTML: div class="dojoTitlePaneLabel">

<label for="q3"> 12 Hour Time </label> <span class="noticeMessage">TimeTextBox? class,

Attributes: {timePattern:'h:mm:ss a'}</span>

</div> <div class="testExample">

<input id="q3" type="text" name="time1b" value="T17:45:00"

dojoType="dijit.form.TimeTextBox?" constraints="{timePattern:'h:mm:ss Å'}" required="true" invalidMessage="Invalid time." />

</div>

...

save as UTF-8, these were tested only for IE8.

Attachments (1)

TimeTextBox002.JPG (31.6 KB) - added by Enrique Rafael Muñoz Flores 9 years ago.
Image

Download all attachments as: .zip

Change History (12)

Changed 9 years ago by Enrique Rafael Muñoz Flores

Attachment: TimeTextBox002.JPG added

Image

comment:1 Changed 9 years ago by Adam Peller

are you sure the page was served using UTF-8 on the server?

comment:2 in reply to:  1 Changed 9 years ago by Enrique Rafael Muñoz Flores

Replying to peller:

are you sure the page was served using UTF-8 on the server?

yes, we double checked, at the time of the original defect creation

comment:3 Changed 9 years ago by Adam Peller

works fine for me. please e-mail me the exact file used and also a link to it on a server, if possible. For local testing, I recommend the use of the meta tag to indicate UTF-8 encoding.

comment:4 Changed 9 years ago by Douglas Hays

When I try to mess with the timepattern I get an exception
dojo.date.locale.format: invalid pattern char: h:mmA ss

comment:5 Changed 9 years ago by Adam Peller

Doug - that's a different case. Characters A-Za-z are considered pattern chars and, if not quoted, would cause an error if they are not valid pattern characters.

comment:6 Changed 9 years ago by Douglas Hays

So e-grave can be either &#x0065;&#x0301; OR &#x00e9; but only the latter (single unicode character) works with patterns since [a-zA-Z] are handled as pattern chars.

comment:7 Changed 9 years ago by Adam Peller

e-grave is e9. The other sequence is probably an encoding, which, put in a page, would probably get double-encoded, no? For the sequence in question, it's in a Javascript string, so it should either be encoded directly into the page or added with a Javascript-style escape (\xe9 or \u00e9)

comment:8 Changed 9 years ago by Enrique Rafael Muñoz Flores

I'll send you guys the files.

comment:9 Changed 9 years ago by Douglas Hays

Resolution: wontfix
Status: newclosed

Since single characters work, then [z-aA-z] will remain reserved characters. I don't see a pressing need to complicate the pattern parser trying to resolve composite characters.

comment:10 Changed 9 years ago by Adam Peller

try putting single quotes around your composite characters. anything with A-Za-z in it needs to be quoted, since those are potentially valid pattern characters and are caught by a regular expression. There is an example in the test suite using o'clock, which actually requires an extra quote to escape the embedded single quote.

comment:11 Changed 9 years ago by Adam Peller

backslashes should be escaped using javascript (
), since the constraints string is effectively a javascript literal. \xnn and \unnnn should also be valid in this context.

Note: See TracTickets for help on using tickets.