SendSysMessage, Print and other methods... how charset...

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Nsuidara
New User
Posts: 12
Joined: Tue Feb 11, 2014 9:24 pm

SendSysMessage, Print and other methods... how charset...

Post by Nsuidara »

Hello.

My question is how can i use UTF-8 in
SendSysMessage or Gumps...

i need charset ź ę ł ó ą ż ...
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: SendSysMessage, Print and other methods... how charset..

Post by Yukiko »

I am not familiar with UTF-8 but is that the same as Unicode? I think you would use the unicode.em module for SendSysMessage etc. but I don't know about gumps. Here is the link to the docs section that lists the functions in that module. I apologize if I am incorrect but as I said I am not familiar with UTF-8 or Unicode I/O.
Nsuidara
New User
Posts: 12
Joined: Tue Feb 11, 2014 9:24 pm

Re: SendSysMessage, Print and other methods... how charset..

Post by Nsuidara »

Yes i know... exist module but dont work...
Zik
Novice Poster
Posts: 41
Joined: Sun Feb 07, 2010 9:39 am

Re: SendSysMessage, Print and other methods... how charset..

Post by Zik »

This ucod include is for Russian unicode, but you can change it to letters you need, and change langcode to your's:
langcode := "RUS"

In UO.EM comment these lines:
//Broadcast( text, font := _DEFAULT_TEXT_FONT, color := _DEFAULT_TEXT_COLOR );
//PrintTextAbove( above_object, text, font := _DEFAULT_TEXT_FONT, color := _DEFAULT_TEXT_COLOR, journal_print := JOURNAL_PRINT_NAME );
//SendSysMessage( character, text, font := _DEFAULT_TEXT_FONT, color := _DEFAULT_TEXT_COLOR );

Don't know if it'll work with basic.em::Print()
I don't see russian letters correctly in a console window. But I never tried to do anything with it.

In scripts you have to add:
use unicode;
include "include/ucod";

and usage will be simple like:
SendSysMessage(who,"Добавлено "+ochk+" очков",3,COLOR_GREEN);

***********

As for the gumps text entries and text input, you'll need to use packethook.
You'll need to change this function:

Code: Select all

function UnicodeParser(byref uniarr)
var i;
for(i := 1; i<=uniarr.size();i+=1)
if(uniarr[i] > 1024)
	uniarr[i]-=848;
endif
endfor
endfunction
Russian letters in UO's fonts.mul start from 176 (1024-848=176).
We changed fonts.mul letter's in some basic fonts, check it with UOFiddler.

And in your client's uo.cfg add:
UnicodeSpeech=on

Hope it'll help you.
Attachments
fonts.rar
Russian fonts.mul
(51.47 KiB) Downloaded 351 times
TextEntry.rar
Russian unicode packethook
(2.12 KiB) Downloaded 364 times
ucod.rar
Russian unicode functions
(5.79 KiB) Downloaded 348 times
Post Reply