⇤ ← Revision 1 as of 2010-06-01 01:09:10
2284
Comment:
|
2808
+encoding problems solve
|
Deletions are marked like this. | Additions are marked like this. |
Line 46: | Line 46: |
=== Problems with characters encoding === Bitlbee uses Unicode in most protocols, and UTF-8 is the most popular character encoding now. But sometimes bitlbee receives misinterpreted characters from servers. Irssi receives correct UTF-8 symbols from bitlbee. And there is no possible code table for /recode command in irssi. [[attachment:ulatrus.pl|This script]] (default ISO-8859-1 to 'cp1251' conversion, for russians) solves this problem in the most transparent way. Place it in ~/.irssi/autorun/ or load manually. |
Irssi Tips
Irssi is a popular text-based irc client for unix-like systems. For more information see the project homepage.
Scripts
Irssi supports a powerful scripting system, with several scripts written specifically for Bitlbee by Tijmen 'timing' Ruizendaal and Matt Sparks.
Scripts are installed into ~/.irssi/scripts/ and loaded inside irssi with the command
/script load scriptname.pl
to have scripts load automatically on startup create a directory autorun inside scripts and link to the script from there:
cd ~/.irssi/scripts/ mkdir autorun cd autorun ln -s ../scriptname.pl
Rewriting Twitter Lines
Updates for twitter accounts in the default mode take the form:
yournick: [01:23:45] <someoneelse> Lorem ipsum dolor sit amet, consectetur adipisicing elit...
literally in raw mode this looks like:
yournick: ^B[^B^B^B01:23:45^B]^B ^B<^Bsomeoneelse^B>^B Lorem ipsum dolor sit amet, consectetur adipisicing elit...
(Note the two extra bold commands after the opening bracket.) These lines can be modified according to regexp rules using the trigger plugin installed as above. Once installed the following triggers may be useful...
Strip yournick from the start of the line so it won't trigger nick highlighting. (Replace yournick with your actual nickname.)
/trigger add -publics -masks '*!twitter_*@twitter' -channels '&bitlbee' -regexp '^yournick: ' -replace '' /trigger save
Next is an alternate, more complicated command that strips yournick, the timestamp that may follow, and puts the name of the tweet sender in green text. Inside the replace statement following \x03 is the 3 indicating the color green. Another color can be chosen from this list.
/trigger add -publics -masks '*!twitter_*@twitter' -channels '&bitlbee' -regexp '^yournick: (\x02\[\x02+\d\d:\d\d:\d\d\x02\]\x02 )?\x02<\x02([^>]+)\x02>\x02' -replace '<\x033$2\x0F>' /trigger save
Problems with characters encoding
Bitlbee uses Unicode in most protocols, and UTF-8 is the most popular character encoding now. But sometimes bitlbee receives misinterpreted characters from servers. Irssi receives correct UTF-8 symbols from bitlbee. And there is no possible code table for /recode command in irssi.
This script (default ISO-8859-1 to 'cp1251' conversion, for russians) solves this problem in the most transparent way. Place it in ~/.irssi/autorun/ or load manually.