[CSM] Unicode Parser [unicodeparser]

Post Reply
muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

[CSM] Unicode Parser [unicodeparser]

by muhdnurhidayat » 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
Last edited by muhdnurhidayat on Wed Jul 11, 2018 13:54, edited 1 time in total.
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by muhdnurhidayat » 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
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by muhdnurhidayat » Post

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
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

User avatar
Lejo
Member
Posts: 708
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
DS-minetest
Member
Posts: 1138
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: DS-minetest
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 DS-minetest » 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.
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

Re: [CSM] Unicode Parser [unicodeparser]

by muhdnurhidayat » 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.
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

User avatar
Lejo
Member
Posts: 708
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: 2370
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [CSM] Unicode Parser [unicodeparser]

by Lone_Wolf » Post

Try using a different font @Lejo

User avatar
Lejo
Member
Posts: 708
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: 2370
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

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

User avatar
Lejo
Member
Posts: 708
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!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest