Last modified: 2012-09-06 00:55:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41558, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39558 - VisualEditor: Edit summary length counter counts characters instead of bytes
VisualEditor: Edit summary length counter counts characters instead of bytes
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: High trivial
: VE-deploy-2012-09-03
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-22 12:12 UTC by Church of emacs
Modified: 2012-09-06 00:55 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Church of emacs 2012-08-22 12:12:33 UTC
The edit summary length counter (which counts backwards from 255) counts characters, not bytes. However, in languages that heavily rely on unicode charaters, a character is usually more than a byte.

When saving an edit with a summary that is accepted by the counter but with more than 255 bytes, a part of the summary is cut off.

Ceterum censeo bug 4715 esse delendam.
Comment 1 Platonides 2012-08-22 12:19:11 UTC
The db accepts 255 bytes. The php code sets the input maxlength to 250 (instead of 255) to account for some of that overhead, and then a javascript is used to adjust it to the real space.
This is a fixed duplicate, unless it is somehow not working right.
Comment 2 Church of emacs 2012-08-22 12:29:03 UTC
Is that a recent fix? On https://www.mediawiki.org/wiki/VisualEditor:Test it does not work as described by you (though it might be that the live version is out of date).
Comment 3 Platonides 2012-08-22 13:09:59 UTC
Oh, I was describing the comment for the normal editor. Yes, the comment counter for the visual editor seems wrong. Sorry.
Comment 4 Krinkle 2012-08-24 14:59:03 UTC
Should use either $.fn.byteLimit (jquery.byteLimit) or $.byteLength (jquery.byteLenght).

byteLength is for calculating the byte count, byteLimit is an application of that but VE might need its own implementation.
Comment 5 Krinkle 2012-09-06 00:55:31 UTC
Fixed in I25e93862a39134961bf80835f46cbf531d8109e0.

Though see also bug 40035.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links