[CSM] Unicode Parser [unicodeparser]

[CSM] Unicode Parser [unicodeparser]

Postby muhdnurhidayat » Mon Apr 23, 2018 7:35 am

Unicode Parser


Image Image Image Image Image Image Image

Unicode Parser (unicodeparser) is a CSM that displays a window for you to write unicode codepoint escapes then it will convert to real text string of that codepoints and send it out on public chat. To show the window, send .ug

The tool to convert text into unicode codepoint escapes is included, it is written in Python2 (for now).

This CSM was created so that I could chat in Chinese and Japanese which uses Input Method Editors (IME) in game but the Windows version of Minetest could never accepts IME into its chat. This is kind of workaround to bypass system limitation.

License: MIT
Depends: None

GitHub | Download | Open bug report

Image

To Do
- Include translation support (which seems to be impossible right now because CSM can't access other files)

+ GIF in action
muhdnurhidayat
Member
 
Posts: 296
Joined: Wed Nov 16, 2016 10:55 pm
GitHub: MuhdNurHidayat
In-game: muhdnurhidayat

Re: [CSM] Unicode Parser [unicodeparser]

Postby muhdnurhidayat » Wed Jul 11, 2018 1:53 pm

I've updated the csm.

Apparently some of the OS that would paste out unicode escape in Minetest uses a different format, \uXXXX instead of \0xXXXX. The new update ensure compatibility with those OS.

Additionally, I've added the command line option as well, so those who prefer to just paste can now do .uc followed by the text, no need to do .ug to open the GUI, but those who prefer to open GUI can still use it as usual.

Here's the new .uc in action, I use the \uXXXX format in the GIF but both format works.
Image
muhdnurhidayat
Member
 
Posts: 296
Joined: Wed Nov 16, 2016 10:55 pm
GitHub: MuhdNurHidayat
In-game: muhdnurhidayat

Re: [CSM] Unicode Parser [unicodeparser]

Postby muhdnurhidayat » Fri Jul 20, 2018 7:07 pm

I've updated the CSM.
New release here: https://github.com/MuhdNurHidayat/unico ... s/tag/v1.2

What's new:
  • The tool now convert the codepoint when you press enter after writing the text, so you don't need to click the button "Convert" anymore, but the button is still there for compatibility reasons.
  • The tool now copies the converted codepoint to your clipboard when ypu enter or press the "Convert" button, so you don't need to manually copy (Ctrl-C) anymore.
  • Added link to GitHub at the tool.
  • The tools now have icon, which is modified from Minetest icon.
  • Added Windows executable for the tool so that those who don't have Python2 would not need to install it just to use the tool.
  • Additional thanks to the following people who either tested the Windows executable file or given some advice to me:
    • Heathcliff#0001 ( Anime Trending Discord server)
    • Fidoze#7037 ( Anime Trending Discord server)
    • Aqo#5414 ( A.I. Channel Unofficial Discord server)
    • xnamkcor#3740 ( A.I. Channel Unofficial Discord server)
(Note: I purposely ask people not from Minetest community to test the executable because I don't want biased feedback.)

This is the ICO file used in the tool:
Image
muhdnurhidayat
Member
 
Posts: 296
Joined: Wed Nov 16, 2016 10:55 pm
GitHub: MuhdNurHidayat
In-game: muhdnurhidayat

Re: [CSM] Unicode Parser [unicodeparser]

Postby Lejo » Sun Jan 06, 2019 6:38 pm

I tried this mod, but i only get a empty output in chat.
Whats' the Problem?
Lejo
Member
 
Posts: 496
Joined: Mon Oct 19, 2015 4:32 pm
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

Postby DS-minetest » Tue Jan 08, 2019 6:24 pm

Lejo wrote:I tried this mod, but i only get a empty output in chat.
Whats' the Problem?

Maybe in your settings the CHAT_MESSAGES restriction flag is set.
DS-minetest
Member
 
Posts: 1069
Joined: Thu Jun 19, 2014 7:49 pm
GitHub: DS-Minetest
In-game: DS

Re: [CSM] Unicode Parser [unicodeparser]

Postby muhdnurhidayat » Thu Jan 10, 2019 10:03 am

DS-minetest wrote:
Lejo wrote:I tried this mod, but i only get a empty output in chat.
Whats' the Problem?

Maybe in your settings the CHAT_MESSAGES restriction flag is set.

It should be working if you use latest stable (0.4.17.1) but it might not working if you use devs version (eg. 5.0.0) because they added in CSM restrictions in devs version.

Also note that it's a CSM (client side mod), don't put it in normal mods folder, instead put it in clientmods folder.
muhdnurhidayat
Member
 
Posts: 296
Joined: Wed Nov 16, 2016 10:55 pm
GitHub: MuhdNurHidayat
In-game: muhdnurhidayat

Re: [CSM] Unicode Parser [unicodeparser]

Postby Lejo » Thu Jan 10, 2019 2:22 pm

muhdnurhidayat wrote:It should be working if you use latest stable (0.4.17.1) but it might not working if you use devs version (eg. 5.0.0) because they added in CSM restrictions in devs version.

I'm using 0.4.17 so this should be no problem
Also note that it's a CSM (client side mod), don't put it in normal mods folder, instead put it in clientmods folder.

I have it in the correct folder otherwise I couldn't use the .uc or .ug command.
I'm allays sending empty:
Code: Select all
<Lejo>

I also tried it on a different computer with 0.4.16
Lejo
Member
 
Posts: 496
Joined: Mon Oct 19, 2015 4:32 pm
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

Postby Lone_Wolf » Thu Jan 10, 2019 8:51 pm

Try using a different font @Lejo
Lone_Wolf
Member
 
Posts: 2150
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

Re: [CSM] Unicode Parser [unicodeparser]

Postby Lejo » Fri Jan 11, 2019 1:35 pm

Try using a different font @Lejo

How can I change it?

I think it's a regular problem with this special charcters.
For example this using CSM also outputs empty(<Lejo> ):
Code: Select all
minetest.register_chatcommand("e", {
  description = "Open the Emoji gui.",
  func = function(name, escuni)
    minetest.send_chat_message("你好")
  end
})

PS: I'm testing in Ubuntu minetest 0.4.17 or using Wine the Windows build, same for both.
Edit:
I also tried this:
Code: Select all
-- command .dummy
minetest.register_chatcommand("dummy", {
   params = "<arg>",
   description = "Dummy function",
   func = function(param)
      local message = "[\xF0\xA0\x80\x8B]" -- \U0002000B
      minetest.log(message) -- works:  visible in debug.txt
      minetest.display_chat_message(message) -- works: visible in game
      minetest.send_chat_message(message) -- doesn't work: truncated to 0x000B

   end
})

I only get the correct output in the debug.
Lejo
Member
 
Posts: 496
Joined: Mon Oct 19, 2015 4:32 pm
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

Postby Lone_Wolf » Fri Jan 11, 2019 4:06 pm

Lejo wrote:
Try using a different font @Lejo

How can I change it?

I think it's a regular problem with this special charcters.
For example this using CSM also outputs empty(<Lejo> ):
Code: Select all
minetest.register_chatcommand("e", {
  description = "Open the Emoji gui.",
  func = function(name, escuni)
    minetest.send_chat_message("你好")
  end
})

PS: I'm testing in Ubuntu minetest 0.4.17 or using Wine the Windows build, same for both.
Edit:
I also tried this:
Code: Select all
-- command .dummy
minetest.register_chatcommand("dummy", {
   params = "<arg>",
   description = "Dummy function",
   func = function(param)
      local message = "[\xF0\xA0\x80\x8B]" -- \U0002000B
      minetest.log(message) -- works:  visible in debug.txt
      minetest.display_chat_message(message) -- works: visible in game
      minetest.send_chat_message(message) -- doesn't work: truncated to 0x000B

   end
})

I only get the correct output in the debug.


Search 'font' in your advanced settings. If needed I can probably give you a step-by-step tutorial on how to change it. If your changes break MT then you'll need to remove the font setting in your minetest.conf
Lone_Wolf
Member
 
Posts: 2150
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf

Re: [CSM] Unicode Parser [unicodeparser]

Postby Lejo » Fri Jan 11, 2019 4:17 pm

Thankssssssssssssssssssssssssssssssssssssssss.
It works for me with the fallback font!
Lejo
Member
 
Posts: 496
Joined: Mon Oct 19, 2015 4:32 pm
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

Postby FrostRanger » Mon Apr 15, 2019 4:25 pm

I can't get it to work on linux mint and SCIM. The conversion tool does nothing when I hit convert (it just closes) and I can't paste into the input anyways so... :/ Shame, this looks like useful mod
FrostRanger
Member
 
Posts: 11
Joined: Thu Oct 11, 2018 5:40 am
GitHub: WulftheNordicRanger
In-game: FrostRanger

Re: [CSM] Unicode Parser [unicodeparser]

Postby muhdnurhidayat » Wed Apr 17, 2019 3:25 pm

Lejo wrote:Thankssssssssssssssssssssssssssssssssssssssss.
It works for me with the fallback font!

I think it works with characters with unicode value less than 0xFFFF including some of chinese characters, but not with those higher than it (due to some issue with minetest itself), you can try to avoid those characters for now and substitute with other characters while the issue is being investigated and fixed (the issue is reported here)...

For example, 你 (meaning 'you') will work as it's 0x4F60 which is lower than 0xFFFF but Image (meaning 'snakefish') will NOT work as it's 0x29F8B which is higher than 0xFFFF...

In the earlier example, you can use the character 䱰 (0x4C70) to substitute Image (0x29F8B) for time being... 䱰 is the traditional chinese form of Image... even if you don't use traditional chinese and this traditional chinese 䱰 don't exist in any newer textbooks after 1964 in regions that uses simplified chinese because it uses Image there, but you had to use it for the time being...

though by doing that, just hope the other player could read it (it won't be problem for elder chinese, but younger chinese are not usually exposed to traditional chinese), or the other player can just use dictionary while playing, since all traditional forms are mentioned inside dictionary alongside the simplified form for compatibility reasons... (though that's based on my blue dictionary named "最新汉语大词典" [Zui xin Hanyu Da Cidian], the standard dictionary in malaysian government-aided chinese primary school... idk if dictionaries in china didn't include traditional chinese as I never been to china yet)

NOTE: I had to use image for Image because this forum will not allow me to write the character as text...
Image

FrostRanger wrote:I can't get it to work on linux mint and SCIM. The conversion tool does nothing when I hit convert (it just closes) and I can't paste into the input anyways so... :/ Shame, this looks like useful mod

can I know the exact OS and which version of the conversion tool that you used?
muhdnurhidayat
Member
 
Posts: 296
Joined: Wed Nov 16, 2016 10:55 pm
GitHub: MuhdNurHidayat
In-game: muhdnurhidayat



Return to Client-side modding



Who is online

Users browsing this forum: Yandex Bot [Bot] and 0 guests