Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.1:Update
xpdf-poppler
xpdf-poppler-search-non-ascii.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xpdf-poppler-search-non-ascii.patch of Package xpdf-poppler
Index: PDFCore.cc =================================================================== --- PDFCore.cc.orig +++ PDFCore.cc @@ -15,6 +15,10 @@ #endif #include <math.h> +#include <locale.h> +#include <langinfo.h> +#include <iconv.h> +#include <endian.h> #include "poppler/goo/GooString.h" #include "poppler/goo/GooList.h" #include "GlobalParamsGUI.h" @@ -1566,15 +1570,32 @@ bool PDFCore::find(char *s, bool caseSen Unicode *u; int len, i; bool ret; + iconv_t cd; + char *inptr, *outptr; + size_t insize, outsize; + size_t nchars; // convert to Unicode len = strlen(s); u = new Unicode[len]; - 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); delete []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