[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Development
. . -> [Subject]  UTF-8 & ANSI positioning code
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

UTF-8 & ANSI positioning code

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1  2 

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #15 on Fri 15 Feb 2013 04:13 AM (UTC)
Message
FallenTree said:



what it should have done, is, when output is in UTF-8 mode, and mushclient got input "<byte1><byte2>" it should encode it as UTF-8 "\Uxxxx\Uxxx\Uxxx\Uxxx" and then send it out, and draw it to screen.


What is "it" here? MUSHclient? The server?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #16 on Wed 27 Feb 2013 07:40 AM (UTC)
Message
sorry to reply late,didn't receive email notification on this one.

i'm referring to mushclient.

when output is utf-8 mode, mushclient should translate input textbox text to utf-8 when sending out.
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #17 on Thu 28 Feb 2013 05:32 AM (UTC)
Message
From what, though? How is it supposed to know what encoding is in use in the input box?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #18 on Fri 01 Mar 2013 12:42 AM (UTC)
Message
Nick Gammon said:

From what, though? How is it supposed to know what encoding is in use in the input box?


it is always the system locale, right? I think here's what is needed:

first, convert system-locale to utf-16

uses: MultibyteToWideChar(CP_THREAD_ACP, .... rest of the args)
then , convert utf-16 to utf-8 : WideCharToMultiByte(CP_UTF8, xxxxxxxx)

the result string is the UTF-8 version of the input string.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd319072(v=vs.85).aspx
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #19 on Tue 12 Mar 2013 05:41 AM (UTC)
Message
Any luck test this out?
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #20 on Wed 13 Mar 2013 07:45 AM (UTC)
Message
It's difficult for me to test but I'll see what I can do.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #21 on Sat 16 Mar 2013 05:03 AM (UTC)
Message
I can test this whenever you have a new build.

Thanks.
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #22 on Sat 16 Mar 2013 06:31 AM (UTC)

Amended on Sat 16 Mar 2013 06:32 AM (UTC) by Nick Gammon

Message
Can you tell me what I am doing wrong here?

I have Chinese encoding turned on, and type "ni hao" which echoes like this:



However as soon as I hit <enter> to send it, it becomes:



And that is before it reaches my code (which I added) to convert it to UTF-8.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #23 on Sun 24 Mar 2013 04:37 AM (UTC)
Message
OK, I think I have it. I didn't have the code page selected. How's this?


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #24 on Sun 24 Mar 2013 05:24 AM (UTC)
Message
Try version 4.90 of MUSHclient.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #25 on Fri 05 Jul 2013 09:25 PM (UTC)
Message
Hi unfortunately 4.90 doesn't work correctly for me, please see example here:

http://imgur.com/CQ15hCf

I typed '你好

but 你好 is displayed as garbled in the window. If things works correctly, i should see 你好 in the window too, I have utf-8 code enabled.

Your help is much appreciated, thanks!
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #26 on Fri 05 Jul 2013 09:27 PM (UTC)
Message
see in the command history window, it is also not displaying correctly:

http://imgur.com/v4wRlEX
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #27 on Sun 07 Jul 2013 07:10 AM (UTC)
Message
What was the objection to running without UTF-8?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #28 on Mon 08 Jul 2013 05:01 AM (UTC)
Message
You mean change the mud server not outputing utf-8? Well, yes, that is how the "old" way works, with many drawbacks, like all string in the source code needs to be in gb2312 (since driver sends them as-is) , etc etc.

By the way, I'm the maintainer of FluffOS (https://github.com/fluffos/fluffos) I understand it must be difficult to try to get things working in non-native language, I will try to see if i could come up with a patch myself.

In another word, thanks for open sourcing mushclient to make this possible.
[Go to top] top

Posted by FallenTree   (14 posts)  [Biography] bio
Date Reply #29 on Mon 08 Jul 2013 05:31 AM (UTC)
Message
I just notice that you actually have a utf-8 fix in 4.91 in cooking. Let me see if problem still exists in current 4.91 after you recent fix, will report back.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,793 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]