/*!
  \file
  \brief UTF8 文字列の操作

  \author Satofumi KAMIMURA

  $Id: utf8_string.cpp 1811 2010-04-30 16:12:05Z satofumi $
*/

#include "utf8_string.h"
#include "Utf8.h"

using namespace qrk;
using namespace std;


size_t qrk::utf8_matchSize(const Utf8& s1, const Utf8& s2)
{
    size_t n = min(s1.size(), s2.size());
    for (size_t i = 0; i < n; ++i) {
        if (s1.ch(i) != s2.ch(i)) {
            return i;
        }
    }
    return n;
}
