ID:2777831
 
Code:
O.maptext = "<span class=\"japanese\">あ"


Problem description:

I set the map control's style sheet to:

.japanese {
text-align: right;
color: black;
font-family:"MS 明朝";
charset: "utf-8";
}


This returns "," as my output. If I set the maptext to "A" instead of "あ", I get the letter "A" in the proper font.

It looks like the map output is still in ansi.

I can send Japanese text to the output window using M << "あ" without having set the style for that window, but I need to output this text to the map.

Help...
The maptext should be Unicode-capable, but check to be sure the font-family is actually right. Also the charset property doesn't exist in DM-CSS; AFAIK it isn't a valid property in even regular CSS.

If you could build a test case including the font you want and send it over, I can take a look and see if the font is being correctly used. And if it isn't, I might be able to find out why.
Thanks for the quick reply!

Looking into other posts re: lang, I found that the upgrade to allow utf-8 in DM was a recent thing.

Updating the software to 514.1583 resolved the issue.

charset was, as you pointed out extraneous.

Thanks again!
Huh... I'm sorry to say that another issue came up.
I switched the code preferences for my project to use a Japanese font in order to type my code.

Under version 511.1385, I could enter my code in Japanese reasonably well but while 514.1583 properly displays the Japanese text in-game, it doesn't allow me to type new Japanese text in the Dreammaker program.

As you likely know, Japanese works on 16bits and many editors combine two spaces to create one character, so passing the cursor over Japanese text in editors sometimes makes things look weird. The 514 version seems to reserve only one space for each full character input.

So, if I write a 5-character word such as こんにちは, which would require 10 spaces to write out, the editor only shows the first two-and-a-half characters and the next two and a half spaces seem to get blanked out, roughly displaying "こんn". So if I wanted to write: M << "こんにちは" the final " wouldn't show in the code (as it would get blanked out) and DM would report an error.

It's possible to work around these issues by editing code on 511 and executing the code on 514. If there's a better solution, I'd like to hear it. Thanks again.
I would suggest using a monospace font that has those characters defined, which I believe is the main reason Dream Maker struggles with them. But, I do need to revisit how it displays characters because there are definitely some issues I've noticed.

If you can shoot me an example file of a simple test project that has some Japanese text in it (literally doesn't have to be anything beyond a verb that spits out text), that'd be helpful. It should be in a UTF-8 encoded file, though, so you might want to use an editor like Sublime to load it in the locale you want and then re-save it as UTF-8. The reason is I'm sure I won't be using the same locale.
I tried setting the font-family as follows everywhere in Byond.dmf:

font-family = "MS mincho",monospace

("MS mincho" is typed here in English but in Japanese in the files)

and as

font-family: "MS mincho",monospace;

in the map style control. The latter works as expected but changing the Byond.dmf seems to make the 511 version as unusable as the 514 version.

If you have a quick fix, that's great but please don't spend much more time on this issue. I can work around it well enough and the benefits to finding a better answer will likely be limited to an extremely limited set of people. Thanks for all of your hard work on Byond!