libtconv-0.1 manual
tconv::set_ienc
void tconv::set_ienc(const char *iEncP = NULL);
declared in tconv.h, include tconv.h

iEncP location of valid C locale, optional, defaults to NULL.

Function takes new input character set encoding to be used in future tasks. It does not validate whether it is valid for given operating system or not. It can be used in cases when converting between many different character formats, with use of a single tconv instance or when the tconv instance was created without initial encoding provided. The string for iEncP must be a valid C locale (LC_CTYPE) for the operating system, where this library is about to be used.

There is no value returned.

Example
// C++ source

#include "tconv.h"

using namespace std;

int main(){
  tconv tc;

  tc.set_ienc("en_US.iso_8859-1");
  // do some input encoding based
  // task...

  return 0;
}

NOTE: Locales shown in the example are POSIX/Linux specific. For MS Windows the locales might look like "English_England.ACP", which represents "windows-1252", "Polish_Poland.OCP", that stands for oem code page "oem-852" or finally "UTF8" for much broader range of characters.

Copyright 2015 TinyIT All rights reserved
Last modified 2015-06-04