Bug 135716 - Create UTF-8 string from in-band VTT cues
Summary: Create UTF-8 string from in-band VTT cues
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
Keywords: InRadar
Depends on:
Reported: 2014-08-07 13:29 PDT by Eric Carlson
Modified: 2014-08-07 20:53 PDT (History)
3 users (show)

See Also:

Proposed patch. (1.42 KB, patch)
2014-08-07 14:04 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2014-08-07 13:29:25 PDT
VTT cues are always UTF-8, so use String::fromUTF8().
Comment 1 Eric Carlson 2014-08-07 14:04:03 PDT
Created attachment 236219 [details]
Proposed patch.
Comment 2 Eric Carlson 2014-08-07 14:05:08 PDT
Committed r172257: https://trac.webkit.org/r172257
Comment 3 Eric Carlson 2014-08-07 14:06:21 PDT
Comment 4 Alexey Proskuryakov 2014-08-07 20:53:25 PDT
Comment on attachment 236219 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=236219&action=review

> Source/WebCore/platform/graphics/ISOVTTCue.cpp:78
> +    return String::fromUTF8(JSC::Uint8Array::create(data, offset, length)->data(), length);

What is the reason to create a UInt8Array here? This seems much more natural to me:

return String::fromUTF8(static_cast<const char*>(data->data()) + offset, length);