[Android] Specify locale for case conversions

Geoffrey Métais git at videolan.org
Thu Feb 12 17:12:32 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 12 11:17:50 2015 +0100| [f899b47de5563b16f3bb48a198b5c6c3e174ac61] | committer: Geoffrey Métais

Specify locale for case conversions

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f899b47de5563b16f3bb48a198b5c6c3e174ac61
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java    |    4 ++--
 vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java  |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index 5100c5c..a84c34d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -113,7 +113,7 @@ public class AudioBrowserListAdapter extends BaseAdapter implements SectionIndex
     public void add(String title, String subTitle, MediaWrapper media) {
         if(title == null) return;
         title = title.trim();
-        final String titleKey = title.toLowerCase();
+        final String titleKey = title.toLowerCase(Locale.getDefault());
         if(subTitle != null) subTitle = subTitle.trim();
         if (mMediaItemMap.containsKey(titleKey))
             mMediaItemMap.get(titleKey).mMediaList.add(media);
@@ -211,7 +211,7 @@ public class AudioBrowserListAdapter extends BaseAdapter implements SectionIndex
     public void addSeparator(String title, MediaWrapper media) {
         if(title == null) return;
         title = title.trim();
-        final String titleKey = title.toLowerCase();
+        final String titleKey = title.toLowerCase(Locale.getDefault());
         if (mSeparatorItemMap.containsKey(titleKey))
             mSeparatorItemMap.get(titleKey).mMediaList.add(media);
         else {
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index bb608bc..8842ddc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -22,6 +22,7 @@ package org.videolan.vlc.gui.video;
 
 import java.io.File;
 import java.nio.ByteBuffer;
+import java.util.Locale;
 
 import org.videolan.libvlc.LibVLC;
 import org.videolan.libvlc.LibVlcException;
@@ -90,7 +91,7 @@ public class MediaInfoFragment extends ListFragment {
         mDelete = (TextView) v.findViewById(R.id.info_delete);
         mSubtitles = (ImageView) v.findViewById(R.id.info_subtitles);
         if (!LibVlcUtil.isICSOrLater())
-            mDelete.setText(getString(R.string.delete).toUpperCase());
+            mDelete.setText(getString(R.string.delete).toUpperCase(Locale.getDefault()));
 
         mPathView.setText(Uri.decode(mItem.getLocation().substring(7)));
         mPlayButton.setOnClickListener(new OnClickListener() {



More information about the Android mailing list