File: test_unicode.cpp

package info (click to toggle)
id3lib3.8.3 3.8.3-13
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,564 kB
  • ctags: 3,071
  • sloc: cpp: 12,358; sh: 9,186; ansic: 7,240; makefile: 349; php: 325
file content (31 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// $Id: test_unicode.cpp,v 1.8 2002/06/29 17:26:18 t1mpy Exp $

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include "id3/id3lib_streams.h"
#include <id3/tag.h>

int main( int argc, char *argv[])
{
  ID3_Tag tag;
  ID3_Frame frame;
  
  tag.Link("test-230-unicode.tag");
  tag.Strip(ID3TT_ALL);
  tag.Clear();
  
  frame.SetID(ID3FID_USERTEXT);
  frame.GetField(ID3FN_DESCRIPTION)->Set("example text frame");
  frame.GetField(ID3FN_TEXT)->Set("This text and the description should be in Unicode.");
  frame.GetField(ID3FN_TEXTENC)->Set(ID3TE_UNICODE);
  tag.AddFrame(frame);
  
  tag.SetPadding(false);
  tag.SetUnsync(false);
  tag.Update(ID3TT_ID3V2);

  return 0;
}