~ubuntu-branches/ubuntu/jaunty/kde4libs/jaunty

« back to all changes in this revision

Viewing changes to kdecore/localization/kencodingprober.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Wenning, Jonathan Thomas, Andreas Wenning
  • Date: 2009-04-01 05:55:52 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090401055552-uel5di5f3xiftax3
Tags: 4:4.2.2-0ubuntu1
[ Jonathan Thomas ]
* New upstream release (LP: #344709, #348823):
  - Bump upstreamversion and runtimedeps in debian/rules
  - Remove kubuntu_65_kcmdlineargs_decoding_svn934640.diff, applied upstream

[ Andreas Wenning ]
* Remove patch kubuntu_69_do_not_show_plasma_popups_over_screensaver.diff,
  applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 *
42
42
 * Always do Unicode probe regardless the ProberType
43
43
 *
44
 
 * Feed data to it several times until ProberState changed to FoundIt/NotMe,
45
 
 * or the Confidence reach a value you think acceptable.
 
44
 * Feed data to it several times with feed() until ProberState changes to FoundIt/NotMe,
 
45
 * or confidence() returns a value you find acceptable.
46
46
 *
47
47
 * Intended lifetime of the object: one instance per ProberType.
48
48
 *
54
54
 * prober.feed(data);
55
55
 * prober.feed(moredata);
56
56
 * if (prober.confidence() > 0.6)
57
 
 *    QString out = QTextCodec::codeForName(prober.encodingName())->toUnicode(data);
 
57
 *    QString out = QTextCodec::codecForName(prober.encoding())->toUnicode(data);
58
58
 * \endcode
59
59
 *
60
 
 * at least 256 characters are needed to change the ProberState from Probing to FoundIt.
61
 
 * if you don't have so many characters to probe, 
 
60
 * At least 256 characters are needed to change the ProberState from Probing to FoundIt.
 
61
 * If you don't have so many characters to probe,
62
62
 * decide whether to accept the encoding it guessed so far according to the Confidence by yourself.
63
63
 *
64
64
 * @short Guess encoding of char array
113
113
     *
114
114
     * feed data to the prober
115
115
     *
116
 
     * @returns the ProberState after probe the feedded data
 
116
     * @returns the ProberState after probing the fed data.
117
117
     */
118
118
    ProberState feed(const QByteArray &data);
119
119
    ProberState feed(const char* data, int len);
125
125
    ProberState state() const;
126
126
 
127
127
    /**
128
 
     * @returns the name of the best encoding it guessed so far
129
 
     */
130
 
    const char* encodingName() const;
 
128
     * @returns the name of the best encoding it has guessed so far
 
129
     * @warning The returned string is allocated with strdup, so some memory is leaked with every call.
 
130
     * @deprecated Use encoding() instead, which returns a QByteArray.
 
131
     */
 
132
    KDE_DEPRECATED const char* encodingName() const;
 
133
 
 
134
    /**
 
135
     * @returns a QByteArray with the name of the best encoding it has guessed so far
 
136
     * @since 4.2.2
 
137
     */
 
138
    QByteArray encoding() const;
131
139
 
132
140
    /**
133
141
     * @returns the confidence(sureness) of encoding it guessed so far (0.0 ~ 0.99), not very reliable for single byte encodings