Merge branch 'develop' of github.com:ennorehling/eressea into develop

This commit is contained in:
Enno Rehling 2019-08-02 12:25:25 +02:00
commit ef71a78cd0
3 changed files with 12 additions and 3 deletions

9
s/convert.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
while [ ! -z $1 ] ; do
tmpfile=$(mktemp eressea.XXX)
iconv -f latin1 -t utf-8 < $1 | \
perl -pe 's/ß/ss/; s/ä/ae/; s/ü/ue/; s/ö/oe/;' \
> $tmpfile && \mv $tmpfile $1
file $1
shift 1
done

View File

@ -56,7 +56,7 @@ size_t unicode_utf8_trim(char *buf)
++result;
}
}
if (op == buf && (iswcntrl(wc) || iswspace(wc))) {
if (op == buf && (iswspace(wc) || !iswprint(wc))) {
result += size;
}
else if (wc>255 || !iscntrl(wc)) {
@ -64,7 +64,7 @@ size_t unicode_utf8_trim(char *buf)
memmove(op, ip, size);
}
op += size;
if (iswcntrl(wc) || iswspace(wc)) {
if (iswspace(wc) || !iswprint(wc)) {
ts += size;
}
else {

View File

@ -19,8 +19,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef _UNICODE_H
#define _UNICODE_H
#include <stdint.h>
#include <stddef.h>
#include <wchar.h>
#ifdef __cplusplus
extern "C" {