Jump to content

Is it possible to support UTF8 in chats and sign board?


daifei4321

Recommended Posts

In fact, I don't know why this limitation exists: (still in 1.2.5)

At client:

net.minecraft.src.ChatAllowedCharacters defined allowed chars.(1)

net.minecraft.src.GuiEditSign allow only allowed characters.(2)

net.minecraft.src.GuiScreen.handleKeyboardInput handle only 1 input character.(3)

At server:

net.minecraft.src.NetServerHandler handleChat forces only allowed chars in chatting.(4) handleUpdateSign replaces all not-allowed chars.(5)

Is it because some character are used for controlling somewhere? Someone made changes and removed these 5 limitations, and it works well so far. (for point3, added processing code)

I usually use Chinese, and Java supports UTF8 by default, so I want to remove these limitation beside using forge. At client side, no file confliction. However, at server side, mm.class (NetServerHandler.java) collide.

I compiled a proper NetServerHandler for my friends this time to include both chinese_support_mod and forge. Is it possible that these limitation be removed directly while injection forge?

What does chinese_support_mod do:

(1) added definition of gbk characters

(2) allow also gbk defined before

(3) if (c > 128 && org.lwjgl.Sys.getVersion().compareTo("2.8.0") < 0){Keyboard.next();char c2 = Keyboard.getEventCharacter();c = (new String(new byte[] {(byte)c, (byte)c2}, java.nio.charset.Charset.defaultCharset().toString().toLowerCase())).toCharArray()[0];}

(4) removed such code

(5) removed such code

Is it possible just remove this whole 'AllowedCharacters' thing?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.