Commit 5be189cb authored by claes's avatar claes

utf8 conversion moved to co_cnv

parent 50e3051b
/*
* Proview $Id: opc_provider.cpp,v 1.15 2007-06-01 11:07:06 claes Exp $
* Proview $Id: opc_provider.cpp,v 1.16 2007-06-01 12:52:40 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -33,6 +33,7 @@
#include "wb_ldh_msg.h"
#include "rt_gdh_msg.h"
#include "co_cdh.h"
#include "co_cnv.h"
#include "co_dcli.h"
#include "pwr_opcclasses.h"
#include "opc_utl.h"
......
/*
* Proview $Id: opc_server.cpp,v 1.20 2007-06-01 11:07:06 claes Exp $
* Proview $Id: opc_server.cpp,v 1.20 2007-06-01 11:07:06 claes Exp $
* Proview $Id: opc_server.cpp,v 1.21 2007-06-01 12:52:40 claes Exp $
* Proview $Id: opc_server.cpp,v 1.21 2007-06-01 12:52:40 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -30,6 +30,7 @@
#include "pwr_opcclasses.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_cnv.h"
#include "rt_gdh.h"
#include "opc_utl.h"
#include "opc_soap_H.h"
......
/*
* Proview $Id: opc_utl.cpp,v 1.19 2007-06-01 11:07:06 claes Exp $
* Proview $Id: opc_utl.cpp,v 1.20 2007-06-01 12:52:40 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1961,34 +1961,3 @@ bool opc_cmp_pwr( void *p1, void *p2, int size, int type, float deadband)
return false;
}
char *cnv_iso8859_to_utf8( char *iso, size_t iso_size)
{
static iconv_t cd = 0;
static char utf8[2048];
char *utf8p = utf8;
size_t utf8_size = sizeof(utf8);
if ( !cd)
cd = iconv_open( "UTF-8", "ISO8859-1");
if ( iconv( cd, &iso, &iso_size, &utf8p, &utf8_size) == (size_t)(-1))
strcpy( utf8, "");
return utf8;
}
char *cnv_utf8_to_iso8859( char *utf8, size_t utf8_size)
{
static iconv_t cd = 0;
static char iso[2048];
char *isop = iso;
size_t iso_size = sizeof(iso);
if ( !cd)
cd = iconv_open( "ISO8859-1", "UTF-8");
if ( iconv( cd, &utf8, &utf8_size, &isop, &iso_size) == (size_t)(-1))
strcpy( iso, "");
return iso;
}
/*
* Proview $Id: opc_utl.h,v 1.17 2007-06-01 11:07:06 claes Exp $
* Proview $Id: opc_utl.h,v 1.18 2007-06-01 12:52:40 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -134,6 +134,3 @@ bool opc_propertynames_to_mask( std::vector<std::string>& pnames, unsigned int *
bool opc_quality_to_string( int quality, char **str);
bool opc_cmp_pwr( void *p1, void *p2, int size, int type, float deadband);
char *cnv_utf8_to_iso8859( char *utf8, size_t utf8_size);
char *cnv_iso8859_to_utf8( char *iso, size_t iso_size);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment