Compare commits
No commits in common. "c8" and "c10s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@ -1 +1,8 @@
|
||||
SOURCES/libunistring-0.9.9.tar.xz
|
||||
libunistring-0.9.3.tar.gz
|
||||
/libunistring-0.9.4.tar.xz
|
||||
/libunistring-0.9.7.tar.xz
|
||||
/libunistring-0.9.8.tar.xz
|
||||
/libunistring-0.9.9.tar.xz
|
||||
/libunistring-0.9.10.tar.xz
|
||||
/libunistring-1.0.tar.xz
|
||||
/libunistring-1.1.tar.xz
|
||||
|
||||
@ -1 +0,0 @@
|
||||
0f7049cf9cdea9d010235cf6c56254693da17eaa SOURCES/libunistring-0.9.9.tar.xz
|
||||
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# libunistring
|
||||
|
||||
This project conatains libunistring i18n testcases
|
||||
@ -1,75 +0,0 @@
|
||||
diff -ru libunistring-0.9.9.orig/lib/fseterr.c libunistring-0.9.9/lib/fseterr.c
|
||||
--- libunistring-0.9.9.orig/lib/fseterr.c 2018-02-28 17:07:03.000000000 +0100
|
||||
+++ libunistring-0.9.9/lib/fseterr.c 2018-08-15 16:40:53.419266090 +0200
|
||||
@@ -1,20 +1,11 @@
|
||||
/* Set the error indicator of a stream.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
- This program is free software: you can redistribute it and/or
|
||||
- modify it under the terms of either:
|
||||
+ This program is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
|
||||
- * the GNU Lesser General Public License as published by the Free
|
||||
- Software Foundation; either version 3 of the License, or (at your
|
||||
- option) any later version.
|
||||
-
|
||||
- or
|
||||
-
|
||||
- * the GNU General Public License as published by the Free
|
||||
- Software Foundation; either version 2 of the License, or (at your
|
||||
- option) any later version.
|
||||
-
|
||||
- or both in parallel, as here.
|
||||
This program 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
|
||||
@@ -32,13 +23,17 @@
|
||||
|
||||
#include "stdio-impl.h"
|
||||
|
||||
+/* This file is not used on systems that have the __fseterr function,
|
||||
+ namely musl libc. */
|
||||
+
|
||||
void
|
||||
fseterr (FILE *fp)
|
||||
{
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
|
||||
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
fp->_flags |= _IO_ERR_SEEN;
|
||||
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
|
||||
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
|
||||
diff -ru libunistring-0.9.9.orig/lib/fseterr.h libunistring-0.9.9/lib/fseterr.h
|
||||
--- libunistring-0.9.9.orig/lib/fseterr.h 2018-02-28 17:07:03.000000000 +0100
|
||||
+++ libunistring-0.9.9/lib/fseterr.h 2018-08-15 16:40:53.419266090 +0200
|
||||
@@ -1,20 +1,11 @@
|
||||
/* Set the error indicator of a stream.
|
||||
Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
|
||||
|
||||
- This program is free software: you can redistribute it and/or
|
||||
- modify it under the terms of either:
|
||||
+ This program is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
|
||||
- * the GNU Lesser General Public License as published by the Free
|
||||
- Software Foundation; either version 3 of the License, or (at your
|
||||
- option) any later version.
|
||||
-
|
||||
- or
|
||||
-
|
||||
- * the GNU General Public License as published by the Free
|
||||
- Software Foundation; either version 2 of the License, or (at your
|
||||
- option) any later version.
|
||||
-
|
||||
- or both in parallel, as here.
|
||||
This program 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
|
||||
@ -1,80 +1,54 @@
|
||||
# This spec file has been automatically updated
|
||||
Version: 0.9.9
|
||||
Release: 3%{?dist}
|
||||
Name: libunistring
|
||||
Group: System Environment/Libraries
|
||||
Summary: GNU Unicode string library
|
||||
License: GPLv2+ or LGPLv3+
|
||||
Url: http://www.gnu.org/software/libunistring/
|
||||
Source0: http://ftp.gnu.org/gnu/libunistring/%{name}-%{version}.tar.xz
|
||||
Patch0: fseterr-update-20180815.patch
|
||||
Requires(post): info
|
||||
Requires(preun): info
|
||||
Provides: bundled(gnulib)
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
%description
|
||||
This portable C library implements Unicode string types in three flavours:
|
||||
(UTF-8, UTF-16, UTF-32), together with functions for character processing
|
||||
(names, classifications, properties) and functions for string processing
|
||||
(iteration, formatted output, width, word breaks, line breaks, normalization,
|
||||
case folding and regular expressions).
|
||||
* Sun Jan 23 2022 Daiki Ueno <dueno@redhat.com> - 1.0-1
|
||||
- Update to upstream 1.0 release
|
||||
- Switch to %%autosetup
|
||||
|
||||
%package devel
|
||||
Group: Development/Libraries
|
||||
Summary: GNU Unicode string library - development files
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-15
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
%description devel
|
||||
Development files for programs using libunistring.
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .fseterr-update
|
||||
* Mon Jun 21 2021 Mike FABIAN <mfabian@redhat.com> - 0.9.10-13
|
||||
- Related rhbz#1938800: Fix CI tests and convert them to tmt
|
||||
|
||||
%build
|
||||
%configure --disable-static --disable-rpath
|
||||
make %{?_smp_mflags}
|
||||
* Mon Jun 14 2021 Mike FABIAN <mfabian@redhat.com> - 0.9.10-12
|
||||
- Fix memory leak in vasnprint. Resolves: rhbz#1938800
|
||||
(Backported from upstream: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4d288a80bf7ebe29334b9805cdcc70eacb6059c1)
|
||||
- Fix spelling in license GPLV2+ -> GPLv2+
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
||||
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}.la
|
||||
# Move staged docs so not picked up by %%doc in main package
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} __doc
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%license COPYING COPYING.LIB
|
||||
%doc AUTHORS NEWS README
|
||||
%{_libdir}/%{name}.so.*
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc HACKING DEPENDENCIES THANKS ChangeLog
|
||||
%doc __doc/*
|
||||
%{_infodir}/%{name}.info*
|
||||
%{_libdir}/%{name}.so
|
||||
%{_includedir}/unistring
|
||||
%{_includedir}/*.h
|
||||
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 0.9.10-8
|
||||
- Use make macros
|
||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||
|
||||
%ldconfig_scriptlets
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
%post devel
|
||||
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
%preun devel
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
fi
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
%changelog
|
||||
* Fri Aug 17 2018 Mike FABIAN <mfabian@redhat.com> - 0.9.9-3
|
||||
- Fix invalid license tag
|
||||
- Resolves: rhbz#1611728
|
||||
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 0.9.10-4
|
||||
- Rebuild with fixed binutils
|
||||
|
||||
* Wed Aug 15 2018 Mike FABIAN <mfabian@redhat.com> - 0.9.9-2
|
||||
- update fseterr from current gnulib to make it build on RHEL-8
|
||||
- Resolves: rhbz#1611728
|
||||
* Sat Jul 28 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.10-3
|
||||
- Replace obsolete scriptlets
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Mon May 28 2018 Daiki Ueno <dueno@redhat.com> - 0.9.10-1
|
||||
- Update to upstream 0.9.10 release
|
||||
|
||||
* Thu Mar 01 2018 Daiki Ueno <dueno@redhat.com> - 0.9.9-1
|
||||
- Update to upstream 0.9.9 release
|
||||
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-10
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
57
libunistring.spec
Normal file
57
libunistring.spec
Normal file
@ -0,0 +1,57 @@
|
||||
# This spec file has been automatically updated
|
||||
Version: 1.1
|
||||
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
|
||||
Name: libunistring
|
||||
Summary: GNU Unicode string library
|
||||
License: GPL-2.0-or-later OR LGPL-3.0-or-later
|
||||
URL: https://www.gnu.org/software/libunistring/
|
||||
Source0: https://ftp.gnu.org/gnu/libunistring/%{name}-%{version}.tar.xz
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
Provides: bundled(gnulib)
|
||||
|
||||
%description
|
||||
This portable C library implements Unicode string types in three flavours:
|
||||
(UTF-8, UTF-16, UTF-32), together with functions for character processing
|
||||
(names, classifications, properties) and functions for string processing
|
||||
(iteration, formatted output, width, word breaks, line breaks, normalization,
|
||||
case folding and regular expressions).
|
||||
|
||||
%package devel
|
||||
Summary: GNU Unicode string library - development files
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Development files for programs using libunistring.
|
||||
|
||||
%prep
|
||||
%autosetup
|
||||
|
||||
%build
|
||||
%configure --disable-static --disable-rpath
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.la
|
||||
# Move staged docs so not picked up by %%doc in main package
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} __doc
|
||||
|
||||
%files
|
||||
%license COPYING COPYING.LIB
|
||||
%doc AUTHORS NEWS README
|
||||
%{_libdir}/%{name}.so.5*
|
||||
|
||||
%files devel
|
||||
%doc HACKING DEPENDENCIES THANKS ChangeLog
|
||||
%doc __doc/*
|
||||
%{_infodir}/%{name}.info*
|
||||
%{_libdir}/%{name}.so
|
||||
%{_includedir}/unistring
|
||||
%{_includedir}/*.h
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
9
plans/basic.fmf
Normal file
9
plans/basic.fmf
Normal file
@ -0,0 +1,9 @@
|
||||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
prepare:
|
||||
how: shell
|
||||
script:
|
||||
- dnf config-manager --enable rhel-CRB --enable rhel-buildroot
|
||||
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (libunistring-1.1.tar.xz) = 01a4267bbd301ea5c389b17ee918ae5b7d645da8b2c6c6f0f004ff2dead9f8e50cda2c6047358890a5fceadc8820ffc5154879193b9bb8970f3fb1fea1f411d6
|
||||
3
tests/README.md
Normal file
3
tests/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# libunistring
|
||||
|
||||
This project conatains libunistring i18n testcases
|
||||
2
tests/libunistring-tests/.gitignore
vendored
Normal file
2
tests/libunistring-tests/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
test
|
||||
testfile.utf*
|
||||
58
tests/libunistring-tests/libunistring_test.py
Normal file
58
tests/libunistring-tests/libunistring_test.py
Normal file
@ -0,0 +1,58 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import logging
|
||||
|
||||
"""
|
||||
Creating a result.log file for saving logs
|
||||
"""
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
logging.info("TEST RESULTS FOR <uniconv.h> FUNCTION\n\n")
|
||||
|
||||
data = []
|
||||
|
||||
TESTTEXT = 'Viele Grüße\n日本語\n'
|
||||
|
||||
def create_testfiles():
|
||||
dummy = subprocess.run("./test '" + TESTTEXT + "'", shell=True)
|
||||
|
||||
def test(path='', encoding=''):
|
||||
"""
|
||||
Read the file at path using the specified encoding and check
|
||||
whether the TESTTEXT can be read back correctly.
|
||||
"""
|
||||
logging.info('Testing file %s using encoding %s', path, encoding)
|
||||
try:
|
||||
with open(path, mode='rt', encoding=encoding) as testfile:
|
||||
text = testfile.read()
|
||||
logging.info('TESTTEXT="%s", text read ="%s"\n', TESTTEXT, text)
|
||||
if text == TESTTEXT:
|
||||
logging.info(
|
||||
'testfile: %s testencoding: %s Read test: SUCCESS',
|
||||
path, encoding)
|
||||
else:
|
||||
logging.info(
|
||||
'testfile: %s testencoding: %s Read test: ERROR',
|
||||
path, encoding)
|
||||
except UnicodeError:
|
||||
logging.error("UTF-8 Conversion Test: UnicodeError")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if sys.byteorder == 'little':
|
||||
endianness = 'le'
|
||||
else:
|
||||
endianness = 'be'
|
||||
testfiles = {
|
||||
'testfile.utf-8': 'utf-8',
|
||||
'testfile.utf-16': 'utf-16' + endianness,
|
||||
'testfile.utf-32': 'utf-32' + endianness,
|
||||
}
|
||||
for testfile in testfiles:
|
||||
if os.path.isfile(testfile):
|
||||
os.unlink(testfile)
|
||||
create_testfiles()
|
||||
for testfile in testfiles:
|
||||
test(path=testfile, encoding=testfiles[testfile])
|
||||
16
tests/libunistring-tests/main.fmf
Normal file
16
tests/libunistring-tests/main.fmf
Normal file
@ -0,0 +1,16 @@
|
||||
summary: Functional test for the gettext module
|
||||
contact: Pooja Yadav <poyadav@redhat.com>
|
||||
component:
|
||||
- python
|
||||
require:
|
||||
- gcc
|
||||
- make
|
||||
- libunistring
|
||||
- libunistring-devel
|
||||
test: bash runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- python
|
||||
duration: 5m
|
||||
extra-summary: /CoreOS/python/libunistring-tests
|
||||
extra-task: /CoreOS/python/libunistring-tests
|
||||
54
tests/libunistring-tests/runtest.sh
Executable file
54
tests/libunistring-tests/runtest.sh
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/python/libunistring-tests
|
||||
# Description: Functional tests for libunistring to check i18n features.
|
||||
# Author: Pooja Yadav <poyadav@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program 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 for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="libunistring"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "gcc test.c -lunistring -o test"
|
||||
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
|
||||
rlRun "cp libunistring_test.py test $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlLog "Run libunistring_test.py"
|
||||
rlRun "python libunistring_test.py"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
||||
38
tests/libunistring-tests/test.c
Normal file
38
tests/libunistring-tests/test.c
Normal file
@ -0,0 +1,38 @@
|
||||
#include <stdio.h>
|
||||
#include <uniconv.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
printf ("Usage: %s <a string>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t len8, len16, len32;
|
||||
|
||||
uint8_t *res8 = u8_conv_from_encoding ("UTF-8", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len8);
|
||||
uint16_t *res16 = u16_conv_from_encoding ("UTF-8", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len16);
|
||||
uint32_t *res32 = u32_conv_from_encoding ("UTF-8", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len32);
|
||||
|
||||
int fd = open ("testfile.utf-8", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
for (int i = 0; i < len8; i++)
|
||||
write (fd, &res8[i], sizeof (uint8_t));
|
||||
close (fd);
|
||||
|
||||
fd = open ("testfile.utf-16", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
for (int i = 0; i < len16; i++)
|
||||
write (fd, &res16[i], sizeof (uint16_t));
|
||||
close (fd);
|
||||
|
||||
fd = open ("testfile.utf-32", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
for (int i = 0; i < len32; i++)
|
||||
write (fd, &res32[i], sizeof (uint32_t));
|
||||
close (fd);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user