diff --git a/src/mog_commons/__init__.py b/src/mog_commons/__init__.py
index 8ce9b36..7525d19 100644
--- a/src/mog_commons/__init__.py
+++ b/src/mog_commons/__init__.py
@@ -1,1 +1,1 @@
-__version__ = '0.1.3'
+__version__ = '0.1.4'
diff --git a/src/mog_commons/collection.py b/src/mog_commons/collection.py
index 21a8f62..621e572 100644
--- a/src/mog_commons/collection.py
+++ b/src/mog_commons/collection.py
@@ -2,6 +2,8 @@ from __future__ import division, print_function, absolute_import, unicode_litera
 
 import six
 
+__all__ = ['get_single_item', 'get_single_key', 'get_single_value', 'distinct']
+
 
 def get_single_item(d):
     """Get an item from a dict which contains just one item."""
@@ -19,3 +21,10 @@ def get_single_value(d):
     """Get a value from a dict which contains just one item."""
     assert len(d) == 1, 'Single-item dict must have just one item, not %d.' % len(d)
     return next(six.itervalues(d))
+
+
+def distinct(xs):
+    """Get the list of distinct values with preserving order."""
+    # don't use collections.OrderedDict because we do support Python 2.6
+    seen = set()
+    return [x for x in xs if x not in seen and not seen.add(x)]
diff --git a/src/mog_commons/string.py b/src/mog_commons/string.py
index 0e6c894..321c6a2 100644
--- a/src/mog_commons/string.py
+++ b/src/mog_commons/string.py
@@ -3,6 +3,21 @@ from __future__ import division, print_function, absolute_import, unicode_litera
 from unicodedata import east_asian_width
 import six
 
+from mog_commons.collection import distinct
+
+__all__ = [
+    'is_unicode',
+    'is_strlike',
+    'unicode_width',
+    'to_unicode',
+    'to_str',
+    'to_bytes',
+    'edge_just',
+    'unicode_right',
+    'unicode_left',
+    'unicode_decode',
+]
+
 __unicode_width_mapping = {'F': 2, 'H': 1, 'W': 2, 'Na': 1, 'A': 2, 'N': 1}
 
 
@@ -104,3 +119,22 @@ def unicode_right(s, width):
             break
         i -= 1
     return s[i:]
+
+
+def unicode_decode(data, encoding_list):
+    """
+    Decode string data with one or more encodings, trying sequentially
+    :param data: bytes: encoded string data
+    :param encoding_list: list[string] or string: encoding names
+    :return: string: decoded string
+    """
+    assert encoding_list, 'encodings must not be empty.'
+
+    xs = distinct(encoding_list if isinstance(encoding_list, list) else [encoding_list])
+    init, last = xs[:-1], xs[-1]
+    for encoding in init:
+        try:
+            return data.decode(encoding)
+        except UnicodeDecodeError:
+            pass
+    return data.decode(last)

Decode string with multiple encodings
diff --git a/src/mog_commons/unittest.py b/src/mog_commons/unittest.py
index 27445ba..06bc135 100644
--- a/src/mog_commons/unittest.py
+++ b/src/mog_commons/unittest.py
@@ -19,6 +19,7 @@ class StringBuffer(object):
 
     We don't use StringIO because there are many differences between PY2 and PY3.
     """
+
     def __init__(self, init_buffer=None):
         self._buffer = init_buffer or b''
 
@@ -37,9 +38,17 @@ class StringBuffer(object):
 
 class TestCase(base_unittest.TestCase):
     def assertRaisesRegexp(self, expected_exception, expected_regexp, callable_obj=None, *args, **kwargs):
-        """Accept difference of the function name between PY2 and PY3."""
-        f = base_unittest.TestCase.assertRaisesRegex if six.PY3 else base_unittest.TestCase.assertRaisesRegexp
-        f(self, expected_exception, expected_regexp, callable_obj, *args, **kwargs)
+        """
+        Accept difference of the function name between PY2 and PY3.
+
+        We don't use built-in assertRaisesRegexp because it is unicode-unsafe.
+        """
+        with self.assertRaises(expected_exception) as cm:
+            callable_obj(*args, **kwargs)
+        if six.PY2:
+            self.assertRegexpMatches(str(cm.exception), expected_regexp)
+        else:
+            self.assertRegex(str(cm.exception), expected_regexp)
 
     def assertOutput(self, expected_stdout, expected_stderr, function, encoding='utf-8'):
         with self.withOutput() as (out, err):
diff --git a/tests/mog_commons/test_collection.py b/tests/mog_commons/test_collection.py
index 2bd136e..da6fda2 100644
--- a/tests/mog_commons/test_collection.py
+++ b/tests/mog_commons/test_collection.py
@@ -1,6 +1,6 @@
 from __future__ import division, print_function, absolute_import, unicode_literals
 
-from mog_commons.collection import get_single_item, get_single_key, get_single_value
+from mog_commons.collection import *
 from mog_commons import unittest
 
 
@@ -31,3 +31,12 @@ class TestCollection(unittest.TestCase):
                                 {})
         self.assertRaisesRegexp(AssertionError, 'Single-item dict must have just one item, not 2.', get_single_value,
                                 {'x': 123, 'y': 45})
+
+    def test_distinct(self):
+        self.assertEqual(distinct([]), [])
+        self.assertEqual(distinct([1]), [1])
+        self.assertEqual(distinct([1] * 100), [1])
+        self.assertEqual(distinct([1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])
+        self.assertEqual(distinct([1, 2, 1, 2, 1]), [1, 2])
+        self.assertEqual(distinct([2, 1, 2, 1, 1]), [2, 1])
+        self.assertEqual(distinct('mog-commons-python'), ['m', 'o', 'g', '-', 'c', 'n', 's', 'p', 'y', 't', 'h'])
diff --git a/tests/mog_commons/test_string.py b/tests/mog_commons/test_string.py
index 2f00173..399abc8 100644
--- a/tests/mog_commons/test_string.py
+++ b/tests/mog_commons/test_string.py
@@ -92,3 +92,19 @@ class TestString(unittest.TestCase):
         self.assertEqual(string.unicode_right('あいうえお', 11), 'あいうえお')
         self.assertEqual(string.unicode_right('あxいxうxえxお', 4), 'xお')
         self.assertEqual(string.unicode_right('あxいxうxえxお', 5), 'えxお')
+
+    def test_unicode_decode(self):
+        self.assertRaisesRegexp(AssertionError, 'encodings must not be empty.', string.unicode_decode, 'abc', [])
+        self.assertEqual(string.unicode_decode(b'abc', 'ascii'), 'abc')
+        self.assertEqual(string.unicode_decode(b'abc', ['ascii']), 'abc')
+        self.assertRaisesRegexp(
+            UnicodeDecodeError, "'ascii' codec can't decode",
+            string.unicode_decode, 'あいうえお'.encode('utf-8'), 'ascii')
+        self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['ascii', 'sjis', 'utf-8']), 'あいうえお')
+        self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['ascii', 'utf-8', 'sjis']), 'あいうえお')
+        self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['utf-8', 'ascii', 'sjis']), 'あいうえお')
+        self.assertEqual(string.unicode_decode('あいうえお'.encode('utf-8'), ['utf-8', 'utf-8', 'utf-8']), 'あいうえお')
+        self.assertEqual(string.unicode_decode('あいうえお'.encode('sjis'), ['ascii', 'utf-8', 'sjis']), 'あいうえお')
+        self.assertRaisesRegexp(
+            UnicodeDecodeError, "'shift_jis' codec can't decode",
+            string.unicode_decode, 'あいうえお'.encode('utf-8'), ['ascii', 'sjis'])

pip install -e .
parse_log_pytest
pytest
coverage coveralls pytest
3.4
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
coveralls==3.3.1
docopt==0.6.2
idna==3.10
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
linecache2==1.0.0
-e git+https://github.com/mogproject/mog-commons-python.git@71a072abdbeff70c14543ef9b307fae3277dc24a#egg=mog_commons
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
requests==2.27.1
six==1.17.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
traceback2==1.4.0
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
unittest2==1.1.0
urllib3==1.26.20
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: mog-commons-python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argparse==1.4.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - coveralls==3.3.1
      - docopt==0.6.2
      - idna==3.10
      - linecache2==1.0.0
      - requests==2.27.1
      - six==1.17.0
      - traceback2==1.4.0
      - unittest2==1.1.0
      - urllib3==1.26.20
prefix: /opt/conda/envs/mog-commons-python

tests/mog_commons/test_collection.py::TestCollection::test_distinct tests/mog_commons/test_string.py::TestString::test_unicode_decode
tests/mog_commons/test_collection.py::TestCollection::test_get_single_item tests/mog_commons/test_collection.py::TestCollection::test_get_single_item_error tests/mog_commons/test_collection.py::TestCollection::test_get_single_key tests/mog_commons/test_collection.py::TestCollection::test_get_single_key_error tests/mog_commons/test_collection.py::TestCollection::test_get_single_value tests/mog_commons/test_collection.py::TestCollection::test_get_single_value_error tests/mog_commons/test_string.py::TestString::test_edge_just tests/mog_commons/test_string.py::TestString::test_edge_just_unicode tests/mog_commons/test_string.py::TestString::test_to_bytes tests/mog_commons/test_string.py::TestString::test_to_str tests/mog_commons/test_string.py::TestString::test_to_str_py3 tests/mog_commons/test_string.py::TestString::test_to_unicode tests/mog_commons/test_string.py::TestString::test_unicode_left tests/mog_commons/test_string.py::TestString::test_unicode_right tests/mog_commons/test_string.py::TestString::test_unicode_width
src/mog_commons/string.py src/mog_commons/__init__.py src/mog_commons/collection.py
src/mog_commons/string.py src/mog_commons/__init__.py src/mog_commons/collection.py