win-1251 bug and possible quickfix

Post Reply
ILIUS
Posts: 7
Joined: Mon Sep 11, 2017 7:12 am

win-1251 bug and possible quickfix

Post by ILIUS »

Having a big problem with WINDOWS-1251 encoding. Mudlet replaces 'я' letter with new line (\n).
Hopefully this will be fixed some day.

But I would appriciate any quick fix.
Tried to replace it with regex trigger. But I cant figure out how to replace "\n".

Perl regex:

Code: Select all

(\r\n?|\n)
Different ways to replace I tried:

Code: Select all

--1
selectString("\n",1)
replace("")
--2
replaceAll("\n", "")
--3
selectCaptureGroup(1)
replace("")
--4
replaceWildcard(1,"")
Last edited by ILIUS on Tue Sep 12, 2017 12:03 pm, edited 1 time in total.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: win-1251 bug and possible quickfix

Post by Vadi »

Sorry to hear about the problem. How can we reproduce the bug so we can see if a workaround is feasible?

ILIUS
Posts: 7
Joined: Mon Sep 11, 2017 7:12 am

Re: win-1251 bug and possible quickfix

Post by ILIUS »

Well I'm playing on sowmud[dot]ru 4662. Not sure if you can play with cyrillic.

As for replacing new line, I believe it's not a problem to reproduce. Actually, I'm not sure that there is an effective way to replace exactly those new lines i need. But still I had no luck replacing any.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: win-1251 bug and possible quickfix

Post by SlySven »

I thought that character was a 'ᴙ' U+1D19 Latin Letter Small Capital Reversed R which is NOT in the Windows 1251 character set encoding but then using Wikipedia I realised you seemed to mean either the character which is encoded at character code 0xdf which is 'Я' U+042F Cyrillic Capital Letter Ya or its lower case 'я' U+044F Cyrillic Small Letter Ya encoded as 0xff. As far as I can tell those (8-bit values) have been encoded correctly (0xdf and 0xff) in the table at the top of src/TBuffer.cpp however I wonder if the 0xff is causing an issue somewhere as that raw 8-bit value (all binary digits 1) has to be transported specially over Telnet {it must be doubled, to flag that it is a single value of that value rather than the start value for a Telnet comment sequence - which begin with that IsACommand value}...

In any case the code for triggering off of non-ASCII characters is not yet in place - and even the display of anything other than ASCII is not yet certain to be correct - I need to go through the character layout/display code first to try and sort out the layout issues before I go on to look at the trigger engine - sorry to say that currently this is all Work in Progress towards Mudlet 4.0 - nevertheless the information you have give will be useful in sorting everything out for that... :)

ILIUS
Posts: 7
Joined: Mon Sep 11, 2017 7:12 am

Re: win-1251 bug and possible quickfix

Post by ILIUS »

The capital letter seems to work just fine, but lower case 'ya' generates the problem.
Could post some sceenshot illustrating the problem. But forum seems to block any links.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: win-1251 bug and possible quickfix

Post by Vadi »

Have you tried KOI-8R, the 3rd option in the login charset menu? Then you can set Mudlet to use KOI-8R and я works fine:

Image

ILIUS
Posts: 7
Joined: Mon Sep 11, 2017 7:12 am

Re: win-1251 bug and possible quickfix

Post by ILIUS »

That was easy :-)
KOI8-R seemd so irrelevant. Didnt even think to try it! Thx!

ILIUS
Posts: 7
Joined: Mon Sep 11, 2017 7:12 am

Re: win-1251 bug and possible quickfix

Post by ILIUS »

Now I'm having problems with KOI8-R in lua scripting. Regex triggers fine, but when I try to check some matches equal to some cyrillic string its not working. And echo returns question marks.

ILIUS
Posts: 7
Joined: Mon Sep 11, 2017 7:12 am

Re: win-1251 bug and possible quickfix

Post by ILIUS »

Actually have same problem with win1251. Gonna have to decode/encode it somehow i believe..
Btw choosing zMud charset replaces 'ya' with 'z' letter. Seems to be an old problem :-)

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: win-1251 bug and possible quickfix

Post by Vadi »

That's the part where like mentioned above we haven't finished yet!

There's no such thing as a zmud charset so I don't know which encoding it actually is using... but we're sure that the KOI one is KOI so that's easy.

Post Reply