Page 1 of 1

[CSM] Unicode Parser [unicodeparser]

Posted: Mon Apr 23, 2018 07:35
by mnh48

Unicode Parser

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)
Spoiler
Image

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Wed Jul 11, 2018 13:53
by mnh48
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

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Fri Jul 20, 2018 19:07
by mnh48
I've updated the CSM.
New release here: https://github.com/mnh48-minetest/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

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Sun Jan 06, 2019 18:38
by Lejo
I tried this mod, but i only get a empty output in chat.
Whats' the Problem?

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Tue Jan 08, 2019 18:24
by Desour
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.

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Thu Jan 10, 2019 10:03
by mnh48
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.

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Thu Jan 10, 2019 14:22
by Lejo
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

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Thu Jan 10, 2019 20:51
by Lone_Wolf
Try using a different font @Lejo

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Fri Jan 11, 2019 13:35
by Lejo
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.

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Fri Jan 11, 2019 16:06
by Lone_Wolf
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

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Fri Jan 11, 2019 16:17
by Lejo
Thankssssssssssssssssssssssssssssssssssssssss.
It works for me with the fallback font!

Re: [CSM] Unicode Parser [unicodeparser]

Posted: Sat Jun 26, 2021 05:05
by mnh48
looks like I forgot to write this earlier, but this CSM has been updated early this year for 5.0+ clients

https://github.com/mnh48-minetest/unico ... s/tag/v1.3

since version 5.0+ introduced CSM restrictions, you will not be able to use this CSM on some of the more restrictive servers, but the other servers will still allow it

Changes to the mod itself

- Fixes error on new MT version which uses minetest.register_on_mods_loaded instead of minetest.register_on_connect
- Added error message if server restricted CSM from sending chat message


Changes to documentation

- Updated all instances of my old name
- Added v1.3 release note
- Added new section "It does not work!"


For server owners

If you want to allow your players to use this CSM, please enable the byteflag CHAT_MESSAGES which control the send_chat_message call client-side using the csm_restriction_flags setting in your minetest.conf file.