~x3lectric/xbmc/svn-trunk

« back to all changes in this revision

Viewing changes to xbmc/Id3Tag.cpp

  • Committer: jmarshallnz
  • Date: 2006-03-14 21:08:04 UTC
  • Revision ID: svn-v4:568bbfeb-2a22-0410-94d2-cc84cf5bfa90:trunk/XBMC:5279
 - 14-03-2006 changed: All strings/labels are internally UTF-8 now.  Will almost certainly require rescanning the databases if you use a non-Ascii charset.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
  CStdString strValue;
24
24
 
25
25
  if (encoding==ID3_FIELD_TEXTENCODING_ISO_8859_1)
26
 
  {
 
26
  { // TODO: UTF-8: Should these be converted to UTF-8 ?
27
27
    id3_latin1_t* latin1=m_dll.id3_ucs4_latin1duplicate(ucs4);
28
 
    strValue=(LPCSTR)latin1;
 
28
    //strValue=(LPCSTR)latin1;
 
29
    g_charsetConverter.stringCharsetToUtf8((LPCSTR)latin1, strValue);
29
30
    m_dll.id3_latin1_free(latin1);
30
31
  }
31
32
  else
32
33
  {
33
 
    g_charsetConverter.utf32ToStringCharset(ucs4, strValue);
 
34
    // convert to UTF-8
 
35
    id3_utf8_t* utf8 = m_dll.id3_ucs4_utf8duplicate(ucs4);
 
36
    strValue = (LPCSTR)utf8;
 
37
    m_dll.id3_utf8_free(utf8);
34
38
  }
35
39
 
36
40
  return strValue;
38
42
 
39
43
id3_ucs4_t* CID3Tag::StringCharsetToUcs4(const CStdString& str) const
40
44
{
41
 
  CStdString strUtf8;
42
 
  g_charsetConverter.stringCharsetToUtf8(str, strUtf8);
43
 
 
44
 
  return m_dll.id3_utf8_ucs4duplicate((id3_utf8_t*)strUtf8.c_str());
 
45
  // our StringCharset is UTF-8
 
46
  return m_dll.id3_utf8_ucs4duplicate((id3_utf8_t*)str.c_str());
45
47
}
46
48
 
47
49
bool CID3Tag::Read(const CStdString& strFile)