mldonkey, a multi-networks file-sharing client - Patches: patch #5123, Fix...
You are not allowed to post comments on this tracker with your current authentication level.
patch #5123: Fix Invalid_argument("UTF8.length") bug in HTML, down-/uploaders
Submitter: | spiralvoice <spiralvoice> | ||
Submitted: | Tue 23 May 2006 05:35:52 PM UTC | ||
Category: | Bug fixes | Priority: | 5 - Normal |
Status: | Done | Assigned to: | None |
Open/Closed: | Closed |
Attached Files
Depends on the following items: None found
Items that depend on this one: None found
CC list is empty
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2006-05-23 | spiralvoice | Status | None | Done | |
Open/Closed | Open | Closed | |||
2006-05-23 | spiralvoice | Attached File | - | Added utf8fix.patch, #10036 |
Powered by Savane 3.13-aa77.
Corresponding source code
Hi Spiralvoice,
Why checking utf8_length of 'str'. You are not sure that 'str' is utf8 encoded. Only 'name' is utf8 encoded, so it won't raise any error if you proceed like this:
let shorten str limit =
(* TODO: we should change all strings to utf8 when
they come into the core instead. *)
let name = Charset.to_utf8 ( String.escaped ) str in
let len = Charset.utf8_length name in
let max_len = maxi limit 10 in
if len > max_len then
let prefix = String.sub name 0 (max_len - 7) in
just a proposal...
regards