QHebrewCodec(3qt)
π QHebrewCodec β the 3qt manual page, bestie edition π
okay so real talk, this is QHebrewCodec(3qt) and it's about conversion to and from visually ordered Hebrew. yes it's niche. yes it's iconic. let's get into it πΈ
β¨ NAME β¨
QHebrewCodec β conversion to and from visually ordered Hebrew π
π SYNOPSIS π
lowkey the important part first: all the functions in this class are reentrant when Qt is built with thread support.
also there's a stray </p> in the original and honestly? we respect the chaos. it stays.
</p>
#include <qrtlcodec.h>
Inherits QTextCodec. π
π Public Members π
virtual const char * mimeName () constvirtual QCString fromUnicode ( const QString & uc, int & lenInOut ) const
π¦ DESCRIPTION π¦
The QHebrewCodec class provides conversion to and from visually ordered Hebrew. that's the whole job. that's the assignment. π
so here's the lore: Hebrew, as a semitic language, is written from right to left. but older computer systems couldn't handle reordering a string so that the first letter appears on the right β they simply could not do it, it was not giving β so a LOT of older documents got encoded in visual order, where the first letter of a line is the rightmost one in the string. yes really. the string is literally backwards compared to how you read it. π
Unicode, by contrast, defines characters to be in logical order (the order you would actually read the string). so this codec tries to convert visually ordered Hebrew (8859-8) to Unicode. and here's the honest disclaimer: this might not always work perfectly, because reversing the bidi (bi-directional) algorithm that transforms from logical to visual order is non-trivial. it's giving "unsolved math problem energy" ngl.
Transformation from Unicode to visual Hebrew (8859-8) is done using the bidi algorithm in Qt, and will produce correct results, so long as the codec is given the text a whole paragraph at a time. places where newlines are supposed to go can be indicated by a newline character ('\n'). β οΈ but heads up: these newline characters change the reordering behaviour of the algorithm, since the bidi reordering only takes place within one line of text, whereas line breaks are determined in visual order. sneaky little detail but it matters fr fr.
Visually ordered Hebrew is still used quite often in some places, mainly in email communication (since most email programs still don't understand logically ordered Hebrew) and on web pages. the web page usage is rapidly decreasing though, due to the availability of browsers that correctly support logically ordered Hebrew. we love to see the glow-up πβ¨
this codec has the name "iso8859-8". and if you don't want any bidi reordering to happen during conversion, use the "iso8859-8-i" codec, which assumes logical order for the 8-bit string. pick your fighter π₯
See also Internationalization with Qt.
π MEMBER FUNCTION DOCUMENTATION π
π§ QCString QHebrewCodec::fromUnicode ( const QString & uc, int & lenInOut ) const
[virtual]
Transforms the logically ordered QString, uc, into a visually ordered string in the 8859-8 encoding. Qt's bidi algorithm is used to perform this task. note that newline characters affect the reordering, since reordering is done on a line by line basis. π§΅
The algorithm is designed to work on whole paragraphs of text, so processing a line at a time may produce incorrect results. this approach is taken because the reordering of the contents of a particular line in a paragraph may depend on the previous line in the same paragraph. so yeah, don't feed it one line at a time, bestie, it will simply not eat. π
Some encodings (for example Japanese or UTF-8) are multibyte (so one input character is mapped to two output characters). the lenInOut argument specifies the number of QChars that should be converted and is set to the number of characters returned.
Reimplemented from QTextCodec.
π const char * QHebrewCodec::mimeName () const
[virtual]
Returns the codec's mime name. short king, one line, we stan. π
Reimplemented from QTextCodec.
β SEE ALSO β
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
πΈ AUTHOR πΈ
Generated automatically from the source code. (not a human, not a bot, just vibes and a build script π«Ά)
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π₯Ί (genuinely, they mean it, good bug reports are the love language of maintainers)
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. π«
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qhebrewcodec.3qt) and the Qt version (3.3.8). that's the whole recipe, don't forget either ingredient bestie π
and that's the page!! π this absolute gem was brought to you by Trolltech AS, dated 2 February 2007, running on Qt version 3.3.8 β no cap, that's the footer, love u, bye!! πβ¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms