News:

Want to praise Simutrans?
Your feedback is important for us ;D.

[r7355]Can not input text in Japanese

Started by Manche, October 28, 2014, 02:43:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Manche

I can not input text in Japanese when rename station, route, vehicle.

I tried input Japanese in pak48,64,96,128 and so on, but will not displayed word as I entered.

ex.) I Inputted 'てすと', when displayed 'fyh' in game.

I was confirmed with before r7100 binary is not occur this bug.

If you want to see this bug, please preparation IME(can input in Japanese).
Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

Ters

Windows, Linux, Mac or something else? If Windows, SDL or GDI?

Manche

Quote from: Ters on October 28, 2014, 04:58:28 PM
Windows, Linux, Mac or something else? If Windows, SDL or GDI?
Windows 8, GDI.
Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

Manche

After previous post, I tried copy and paste words into text box(station name, route name), I could do that.

But I used GDI version, why I can not input Japanese in direct ?
Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

Ters

I think prissi is the only one who can look into this problem.

Manche

#5
in order to check whether the problem occurs only my environment,rather than others.
Therefore I asked to other Japanese player, they replied 'I know that problem,too.'.

Moreover, I asked them what uses version, the answer was 'Ver120 or higher'.

I know the problem not occurs in Ver112.4 or lower.

Summary until now posts(w/ contains that I picked up some informations),


  • Environment is Windows8 64bit (Japanese, home edition).
  • Can not rename stations name.
  • Can not rename routes name.
  • Can not rename companys name.
  • Can only input with copy and paste.
  • Use the Google IME.
  • Occurs only in Ver120.0 RC or higher.
  • Not occurs in Ver112.4 or lower

Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

yoshi

I haven't checked with the latest nightly, but don't have any problem with 120.0 at least

Manche

Quote from: yoshi on November 01, 2014, 02:35:00 AM
I haven't checked with the latest nightly, but don't have any problem with 120.0 at least
I tried to be confirmed also on the r7356, But I couldn't input.
Please show how environment do you have(like my previous post)?
Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

yoshi

I have tried with r7348 and confirmed that Japanese characters are garbled, when I tried to change a station name.

prissi

#9
Some user seem to have troubles with WIndow8 64 bit. I had only Windows 8.1 professional english with Japanese IME for testing and there is works fine.

I may be a very windows version specific problem, since deep down Simutrans calls windows functions which exist since the dawn of windows. Even google crome has this problem when started in App mode. So maybe Simutrans must not started as App (but I have no idea how to signal this to windows). Maybe when switching to full screen mode windows make SImutrans an App. Does the input work in windowed mode?

It seems MS has introduced something called TSF (text service foundation), which would force a program to be compiled for Windows8 only to use it. Destop applications should however still get IME messages (and hence Unicode letters).

Maybe try to set the compatibility settings to Windows7?

Manche

I tried to set compatibility setting to Windows 7 in addition to windows vista and windows xp.
Windows 7:Failure
Windows Vista SP2:Failure
Windows XP SP2:Failure

may be, some hardware or system affect to simutrans.
I tried in my other sub environment.
sub environment has:
windows 7 32bit home edition
Has google IME

Result: Failure

Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

prissi

OK, I made the main window now using a wide character function in r7360.

Manche

Quote from: prissi on November 09, 2014, 10:13:25 PM
OK, I made the main window now using a wide character function in r7360.
I couldn't download r7360 (with compile error).

I was append log file to this post.
Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830

Ters

#13
mingw runs on an ancient C runtime that predates Microsoft's so called secure versions of string processing functions. I've tried emulating what mbstowcs_s does beyond regular mbstowcs, but the result crashes when not run in a debugger. Now I have to run off to work, so I can't offer any tried and tested solution. In this case, just using mbstowcs might be safe, though.

Update
My trouble with crashing was probably because my personal workaround for version 4 of the mingw runtime/w32api had been reverted. Since the mingw team has withdrawn that version, I have also kicked it out of my system.

That left me with a window that only said S. This seems to be something else that is strange, since even a string literal comes out that way. As for string litterals, SIM_TITLE is made up of string litterals, so I think it is actually possible to skip alle the mbstowcs nonesense and simple put L""SIM_TITLE directly into the parameters for CreateWindowExW. It works for me (except for my trouble with only the first letter showing, but when using the debugger, the actual data passed into CreateWindowExW looks correct).

Update 2
Thanks to Google and stackoverflow for pointing out that DefWindowProcW goes with RegisterClassW and/or CreateWindowExW. This might even be what causes IME to fail. It seem to recall something being done with regards to ...W or not relatively recently.

prissi

#14
Well, using L""SIM_TITLE does not work under windows:
1>simsys_w.cc(104): error C2308: Nicht übereinstimmende Zeichenfolgen werden verkettet.
1>          wide "" wird mit narrow "Simutrans " verkettet.
Meaning "non mathching strings wide with narrow are being concentated"

EDIT: after compiling 7360 under mingw I cannot input japanese under windows7 any more ...

I think it would be helpful if we can get a little closer to the faulty revision. Some versions of SImutrans are release without COnsole opening. This may also have an impact.

EDIT2: Calling the wide windows defaulot function seems to work better on WIndows7 at least.

Ters

Quote from: prissi on November 10, 2014, 10:02:55 PM
Well, using L""SIM_TITLE does not work under windows:
1>simsys_w.cc(104): error C2308: Nicht übereinstimmende Zeichenfolgen werden verkettet.
1>          wide "" wird mit narrow "Simutrans " verkettet.
Meaning "non mathching strings wide with narrow are being concentated"

Does not work with Microsoft's C++ compiler most likely. It was a long shot.

Quote from: prissi on November 10, 2014, 10:02:55 PM
EDIT: after compiling 7360 under mingw I cannot input japanese under windows7 any more ...

Since simsys_w.cc uses DefWindowProc, and not explicitly DefWindowProcA or DefWindowProcW, could it be that MSVC now defines UNICODE by default? That would cause DefWindowProc to resolve to DefWindowProcW with MSVC, which works together with the explicit RegisterClassW, while Mingw resolves to DefWindowProcA, which messes things up.

Quote from: prissi on November 10, 2014, 10:02:55 PM
I think it would be helpful if we can get a little closer to the faulty revision.

My guess is 7206.

Manche

Earlier, I checked nightly web site, then r7363 was released.
I could input Japanese text into station name, route name.
thanks to your support.

Ye, Olde, simutrans Player, from 2004.
In Japanese, "Manche" is spelled "まんちぇ".
Sometimes provide translation and addons.

Discord: MancheHeckens#4830