/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <langinfo.h>
#include <iconv.h>
#include "utf.h"
/* Global variables */
/*
* Initialize all utf processing.
*/
{
char *codeset;
/* Set the locale from the environment */
/* Get the codeset name */
return ui;
}
/* If we don't need this, skip it */
return ui;
}
/* Open conversion descriptors */
UTF_ERROR("Failed to complete iconv_open() setup");
}
UTF_ERROR("Failed to complete iconv_open() setup");
}
return ui;
}
/*
* Terminate all utf processing
*/
void JNICALL
{
}
}
}
/*
* Do iconv() conversion.
* Returns length or -1 if output overflows.
*/
static int
{
int outputLen = 0;
UTF_ASSERT(len>=0);
output[0] = 0;
outputLen = 0;
int returnValue;
char *inbuf;
char *outbuf;
if ( returnValue >= 0 && inLeft==0 ) {
return outputLen;
}
/* Failed to do the conversion */
return -1;
}
/* Just copy bytes */
return outputLen;
}
/*
* Convert UTF-8 to Platform Encoding.
* Returns length or -1 if output overflows.
*/
int JNICALL
{
/* Negative length is an error */
if ( len < 0 ) {
return -1;
}
/* Zero length is ok, but we don't need to do much */
if ( len == 0 ) {
output[0] = 0;
return 0;
}
}
/*
* Convert Platform Encoding to UTF-8.
* Returns length or -1 if output overflows.
*/
int JNICALL
{
/* Negative length is an error */
if ( len < 0 ) {
return -1;
}
/* Zero length is ok, but we don't need to do much */
if ( len == 0 ) {
output[0] = 0;
return 0;
}
}