[CSM] Unicode Parser [unicodeparser]

Post Reply
User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

[CSM] Unicode Parser [unicodeparser]

by mnh48 » Post

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
Last edited by mnh48 on Sat Jun 26, 2021 03:59, edited 2 times in total.

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by mnh48 » Post

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

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by mnh48 » Post

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
Last edited by mnh48 on Sat Jun 26, 2021 03:59, edited 1 time in total.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

by Lejo » Post

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

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [CSM] Unicode Parser [unicodeparser]

by Desour » Post

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.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by mnh48 » Post

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.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

by Lejo » Post

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

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [CSM] Unicode Parser [unicodeparser]

by Lone_Wolf » Post

Try using a different font @Lejo
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

by Lejo » Post

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.

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [CSM] Unicode Parser [unicodeparser]

by Lone_Wolf » Post

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
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [CSM] Unicode Parser [unicodeparser]

by Lejo » Post

Thankssssssssssssssssssssssssssssssssssssssss.
It works for me with the fallback font!

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by mnh48 » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests