Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
xpdf
xpdf-search-non-ascii.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xpdf-search-non-ascii.patch of Package xpdf
--- xpdf-3.01/xpdf/PDFCore.cc +++ xpdf-3.01/xpdf/PDFCore.cc @@ -13,6 +13,10 @@ #endif #include <math.h> +#include <locale.h> +#include <langinfo.h> +#include <iconv.h> +#include <endian.h> #include "GString.h" #include "GList.h" #include "GlobalParams.h" @@ -1312,15 +1316,33 @@ Unicode *u; int len, i; GBool ret; + iconv_t cd; + char *inptr, *outptr; + size_t insize, outsize; + size_t nchars; // convert to Unicode len = strlen(s); u = (Unicode *)gmallocn(len, sizeof(Unicode)); - for (i = 0; i < len; ++i) { - u[i] = (Unicode)(s[i] & 0xff); + + nchars = len; + if (len > 0) { +#if __BYTE_ORDER == __LITTLE_ENDIAN + cd = iconv_open ("UCS-4LE",nl_langinfo (CODESET)); +#else + cd = iconv_open ("UCS-4BE",nl_langinfo (CODESET)); +#endif + inptr = s; + outptr = (char *) u; + insize = len; + outsize = (len * sizeof(Unicode)); + memset (u, 0, (len * sizeof(Unicode))); + iconv (cd, &inptr, &insize, &outptr, &outsize); + nchars = len-outsize/4; + iconv_close (cd); } - ret = findU(u, len, caseSensitive, next, backward, onePageOnly); + ret = findU(u, nchars, caseSensitive, next, backward, onePageOnly); gfree(u); return ret;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor