$63 GRAYBYTE WORDPRESS FILE MANAGER $42

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/alt-nodejs19/root/usr/share/doc/alt-nodejs19-libicu-devel/samples/date/

HOME
Current File : /opt/alt/alt-nodejs19/root/usr/share/doc/alt-nodejs19-libicu-devel/samples/date//uprint.c
/*
***********************************************************************
* © 2016 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
***********************************************************************
**********************************************************************
* Copyright (C) 1998-2001, International Business Machines Corporation
* and others.  All Rights Reserved.
**********************************************************************
*
* File date.c
*
* Modification History:
*
*	Date		Name		Description
*	06/14/99	stephen 	Creation.
*******************************************************************************
*/

#include "uprint.h"

#include <stdbool.h>
#include "unicode/ucnv.h"
#include "unicode/ustring.h"

#define BUF_SIZE 128

/* Print a ustring to the specified FILE* in the default codepage */
void
uprint(const UChar *s,
	   FILE *f,
	   UErrorCode *status)
{
  /* converter */
  UConverter *converter;
  char buf [BUF_SIZE];
  int32_t sourceLen;
  const UChar *mySource;
  const UChar *mySourceEnd;
  char *myTarget;
  int32_t arraySize;

  if(s == 0) return;

  /* set up the conversion parameters */
  sourceLen    = u_strlen(s);
  mySource	   = s;
  mySourceEnd  = mySource + sourceLen;
  myTarget	   = buf;
  arraySize    = BUF_SIZE;

  /* open a default converter */
  converter = ucnv_open(0, status);
  
  /* if we failed, clean up and exit */
  if(U_FAILURE(*status)) goto finish;
  
  /* perform the conversion */
  do {
	/* reset the error code */
	*status = U_ZERO_ERROR;

	/* perform the conversion */
	ucnv_fromUnicode(converter, &myTarget,	myTarget + arraySize,
			 &mySource, mySourceEnd, NULL,
			 true, status);

	/* Write the converted data to the FILE* */
	fwrite(buf, sizeof(char), myTarget - buf, f);

	/* update the conversion parameters*/
	myTarget	 = buf;
	arraySize	 = BUF_SIZE;
  }
  while(*status == U_BUFFER_OVERFLOW_ERROR); 

 finish:
  
  /* close the converter */
  ucnv_close(converter);
}


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.41 PM
root / root
0755
Makefile
1.64 KB
22 Feb 2023 10.01 AM
root / root
0644
Makefile.in
1.653 KB
19 Oct 2022 12.53 AM
root / root
0644
date.c
9.94 KB
19 Oct 2022 12.53 AM
root / root
0644
date.sln
1.17 KB
19 Oct 2022 12.53 AM
root / root
0644
date.vcxproj
7.835 KB
19 Oct 2022 12.53 AM
root / root
0644
date.vcxproj.filters
1.057 KB
19 Oct 2022 12.53 AM
root / root
0644
readme.txt
2.294 KB
19 Oct 2022 12.53 AM
root / root
0644
uprint.c
1.963 KB
19 Oct 2022 12.53 AM
root / root
0644
uprint.h
0.96 KB
19 Oct 2022 12.53 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF