Commit 04342f2b by Oliver Woodman

Don't use toLowerCase :).

It can do weird things if the device has an unusual default Locale.
Util.toLowerInvariant uses the US Locale, which does the right thing
in this case.
parent eeb73a86
......@@ -21,6 +21,7 @@ import com.google.android.exoplayer.text.Subtitle;
import com.google.android.exoplayer.text.SubtitleParser;
import com.google.android.exoplayer.util.MimeTypes;
import com.google.android.exoplayer.util.ParserUtil;
import com.google.android.exoplayer.util.Util;
import android.graphics.Color;
import android.text.Layout;
......@@ -224,14 +225,14 @@ public final class TtmlParser implements SubtitleParser {
break;
case TtmlNode.ATTR_TTS_FONT_WEIGHT:
style = createIfNull(style).setBold(
TtmlNode.BOLD.equals(attributeValue.toLowerCase()));
TtmlNode.BOLD.equalsIgnoreCase(attributeValue));
break;
case TtmlNode.ATTR_TTS_FONT_STYLE:
style = createIfNull(style).setItalic(
TtmlNode.ITALIC.equals(attributeValue.toLowerCase()));
TtmlNode.ITALIC.equalsIgnoreCase(attributeValue));
break;
case TtmlNode.ATTR_TTS_TEXT_ALIGN:
switch (attributeValue.toLowerCase()) {
switch (Util.toLowerInvariant(attributeValue)) {
case TtmlNode.LEFT:
style = createIfNull(style).setTextAlign(Layout.Alignment.ALIGN_NORMAL);
break;
......@@ -250,7 +251,7 @@ public final class TtmlParser implements SubtitleParser {
}
break;
case TtmlNode.ATTR_TTS_TEXT_DECORATION:
switch (attributeValue.toLowerCase()) {
switch (Util.toLowerInvariant(attributeValue)) {
case TtmlNode.LINETHROUGH:
style = createIfNull(style).setLinethrough(true);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment