Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 102966 Details for
Bug 152546
Recode man output into UTF-8 encoding in kio_man (By Sergey A. Sukiyazov <corwin@altlinux.ru>)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
copy of man_recode patch
kdebase-3.5.0-man_recode.patch (text/plain), 2.39 KB, created by
Sergey A. Sukiyazov
on 2006-11-29 00:42:52 UTC
(
hide
)
Description:
copy of man_recode patch
Filename:
MIME Type:
Creator:
Sergey A. Sukiyazov
Created:
2006-11-29 00:42:52 UTC
Size:
2.39 KB
patch
obsolete
>diff -Naur kdebase-3.5.0-orig/kioslave/man/kio_man.cpp kdebase-3.5.0/kioslave/man/kio_man.cpp >--- kdebase-3.5.0-orig/kioslave/man/kio_man.cpp 2005-10-10 19:04:01 +0400 >+++ kdebase-3.5.0/kioslave/man/kio_man.cpp 2006-01-01 19:49:28 +0300 >@@ -30,6 +30,8 @@ > #include <qptrlist.h> > #include <qmap.h> > #include <qregexp.h> >+#include <qtextcodec.h> >+#include <qfileinfo.h> > > #include <kdebug.h> > #include <kinstance.h> >@@ -566,6 +568,51 @@ > > if (array.isEmpty()) > return 0; >+ >+ //-------- Make locale encoded manpage text --------------------------------- >+ QTextCodec *loc_codec = QTextCodec::codecForLocale(); >+ if (loc_codec) { >+ QTextCodec *man_codec = 0; >+ >+ // Try .charmap file in manpage dir >+ QFileInfo fi(QFile::decodeName(_filename)); >+ QFile file(fi.dirPath(true).replace(QRegExp("/man\\w$"),"/.charset")); >+ >+ if ( file.open( IO_ReadOnly ) ) { >+ QTextStream stream( &file ); >+ QString man_charmap; >+ >+ man_charmap = stream.readLine(); // line of text excluding '\n' >+ file.close(); >+ if (!man_charmap.isEmpty()) { >+ man_codec = QTextCodec::codecForName(man_charmap.latin1()); >+ } >+ } >+ >+ // Can't find .charmap file or its empty. Try environment >+ // variable >+ if(!man_codec) { >+ char *env = getenv("MAN_ICONV_INPUT_CHARSET"); >+ if(env && *env) >+ man_codec = QTextCodec::codecForName(env); >+ } >+ >+ // No manpage charmap specified, use UTF-8 as default >+ //if(!man_codec) >+ // man_codec = QTextCodec::codecForMib(106); >+ >+ if(man_codec) { >+ if (loc_codec->mibEnum()!=man_codec->mibEnum()) { >+ // Locale has difer charmap than manpage >+ QString unicode; >+ >+ kdDebug(7107) << "recode " << man_codec->name() << " to " << loc_codec->name() << endl; >+ unicode = man_codec->toUnicode(array); >+ array = loc_codec->fromUnicode(unicode); >+ } >+ } >+ } >+ //-------------------------------------------------------------------------- > > const int len = array.size(); > buf = new char[len + 4];
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 152546
:
102964
|
102965
| 102966 |
109936