Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 899034 Details for
Bug 915448
Spell check problem (UTF8 conversion?) with Hunspell
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
0001-Resolves-rhbz-915448-UTF-8-handling.patch
0001-Resolves-rhbz-915448-UTF-8-handling.patch (text/plain), 4.03 KB, created by
Maciek Borzecki
on 2014-05-25 06:48:59 UTC
(
hide
)
Description:
0001-Resolves-rhbz-915448-UTF-8-handling.patch
Filename:
MIME Type:
Creator:
Maciek Borzecki
Created:
2014-05-25 06:48:59 UTC
Size:
4.03 KB
patch
obsolete
>From 0fdf49b027b3e8f0a95694f22473d0727af405bc Mon Sep 17 00:00:00 2001 >From: Maciek Borzecki <maciek.borzecki@gmail.com> >Date: Sun, 18 May 2014 21:38:51 +0200 >Subject: [PATCH] Resolves: rhbz#915448, UTF-8 handling > >Integrated patch from >http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7781#31 > >Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> >--- > hunspell.rhbz915448.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++ > hunspell.spec | 8 ++++++- > 2 files changed, 62 insertions(+), 1 deletion(-) > create mode 100644 hunspell.rhbz915448.patch > >diff --git a/hunspell.rhbz915448.patch b/hunspell.rhbz915448.patch >new file mode 100644 >index 0000000000000000000000000000000000000000..7b9c9fc4792e89cb5bf1711db8d49db068439832 >--- /dev/null >+++ b/hunspell.rhbz915448.patch >@@ -0,0 +1,55 @@ >+--- src/tools/hunspell.cxx~0 2011-01-21 19:01:29.000000000 +0200 >++++ src/tools/hunspell.cxx 2013-02-07 10:11:54.443610900 +0200 >+@@ -710,13 +748,22 @@ if (pos >= 0) { >+ fflush(stdout); >+ } else { >+ char ** wlst = NULL; >+- int ns = pMS[d]->suggest(&wlst, token); >++ int byte_offset = parser->get_tokenpos() + pos; >++ int char_offset = 0; >++ if (strcmp(io_enc, "UTF-8") == 0) { >++ for (int i = 0; i < byte_offset; i++) { >++ if ((buf[i] & 0xc0) != 0x80) >++ char_offset++; >++ } >++ } else { >++ char_offset = byte_offset; >++ } >++ int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d])); >+ if (ns == 0) { >+- fprintf(stdout,"# %s %d", token, >+- parser->get_tokenpos() + pos); >++ fprintf(stdout,"# %s %d", token, char_offset); >+ } else { >+ fprintf(stdout,"& %s %d %d: ", token, ns, >+- parser->get_tokenpos() + pos); >++ char_offset); >+ fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], io_enc)); >+ } >+ for (int j = 1; j < ns; j++) { >+@@ -745,13 +792,23 @@ if (pos >= 0) { >+ if (root) free(root); >+ } else { >+ char ** wlst = NULL; >++ int byte_offset = parser->get_tokenpos() + pos; >++ int char_offset = 0; >++ if (strcmp(io_enc, "UTF-8") == 0) { >++ for (int i = 0; i < byte_offset; i++) { >++ if ((buf[i] & 0xc0) != 0x80) >++ char_offset++; >++ } >++ } else { >++ char_offset = byte_offset; >++ } >+ int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d])); >+ if (ns == 0) { >+ fprintf(stdout,"# %s %d", chenc(token, io_enc, ui_enc), >+- parser->get_tokenpos() + pos); >++ char_offset); >+ } else { >+ fprintf(stdout,"& %s %d %d: ", chenc(token, io_enc, ui_enc), ns, >+- parser->get_tokenpos() + pos); >++ char_offset); >+ fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], ui_enc)); >+ } >+ for (int j = 1; j < ns; j++) { >diff --git a/hunspell.spec b/hunspell.spec >index 402f89b1c7ded5e09cbdaf1e031013cfe3823a4b..e167e631258ad70db073bf1ca2f9df926338a7f2 100644 >--- a/hunspell.spec >+++ b/hunspell.spec >@@ -3,7 +3,7 @@ > Name: hunspell > Summary: A spell checker and morphological analyzer library > Version: 1.3.2 >-Release: 14%{?dist} >+Release: 16%{?dist} > Source: http://downloads.sourceforge.net/%{name}/hunspell-%{version}.tar.gz > Group: System Environment/Libraries > URL: http://hunspell.sourceforge.net/ >@@ -21,6 +21,7 @@ Patch0: hunspell.rhbz759647.patch > Patch1: hunspell.rhbz918938.patch > Patch2: hunspell-aarch64.patch > Patch3: hunspell.rhbz985052.patch >+Patch4: hunspell.rhbz915448.patch > > %description > Hunspell is a spell checker and morphological analyzer library and program >@@ -42,6 +43,7 @@ Includes and definitions for developing with hunspell > %patch1 -p0 -b .rhbz918938 > %patch2 -p1 -b .aarch64 > %patch3 -p0 -b .rhbz985052 >+%patch4 -p0 -b .rhbz915448 > > %build > configureflags="--disable-rpath --disable-static --with-ui --with-readline" >@@ -131,6 +133,10 @@ rm -rf $RPM_BUILD_ROOT > %{_mandir}/man3/hunspell.3.gz > > %changelog >+* Sun May 18 2014 maciek <maciek@corsair.lan> - 1.3.2-16 >+- Resolves: rhbz#915448, UTF-8 handling patch from >+ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7781#31 >+ > * Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 1.3.2-14 > - Perl 5.18 rebuild > >-- >1.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 915448
: 899034