Saturday, 31 May 2014

Mojibake

The instructions for the Japanese programs I download often appear as gibberish (lots of question marks or other unusual symbols) when I open them in a text editor on my PC.

This happens because the text has been decoded using a different character encoding than was used to write the text.

The Japanese call this Mojibake.



Here is what part of Mikoto2x’s “readme.txt” looks like when I open it.

Mikoto2X


yŠT—vz

Metasequoia ‚Æ Mikoto ‚ðŽg‚Á‚čì‚Á‚½ƒ‚[ƒVƒ‡ƒ“•t‚«3Dƒ‚ƒfƒ‹ƒtƒ@ƒCƒ‹i.mqo, .mkmj‚ð
DirectX ‚ÅŽg‚¦‚éŒ`Ž®i.xj‚É•ÏŠ·‚·‚éƒvƒƒOƒ‰ƒ€‚Å‚·B

‚È‚¨AMetasequoia 2.3.2AMetasequoiaLE R2.1AMikoto 0.4f ‚ÌŽg—p‚ð‘z’肵‚Ä‚¢‚Ü‚·‚ªA
‚»‚ê‚æ‚èV‚µ‚¢ƒo[ƒWƒ‡ƒ“‚Å‚à‘½•ª‘åä•v‚Å‚µ‚傤B

Metasequpia http://www21.ocn.ne.jp/~mizno/metaseq/index.html
Mikoto  http://sasakingdom.com/mikoto.html


y“à—ez

Mikoto2X.exe  .mqo, .mkm -> .x ƒRƒ“ƒo[ƒ^B
xsmooth.exe  Xƒtƒ@ƒCƒ‹‚ðƒXƒ€[ƒWƒ“ƒO‚·‚éƒc[ƒ‹B•ÏŠ·Œ³ƒtƒ@ƒCƒ‹‚̏C³‚ÉŽg—pB
XAnimationMesh.exe Xƒtƒ@ƒCƒ‹‚ð•\Ž¦‚·‚éƒc[ƒ‹B•ÏŠ·Œã‚̃tƒ@ƒCƒ‹‚̃vƒŒƒrƒ…[‚ÉŽg—pB
ASCII.png  XAnimationMesh.exe‚Ì•t•¨B
readme.txt  ‚±‚êB
src/   ã‹L‚̃vƒƒOƒ‰ƒ€‚̃\[ƒXƒR[ƒhBVC7.0EVC7.1 —pB
sample/   ‰º‚Ìà–¾‚ÅŽg‚¤ƒTƒ“ƒvƒ‹ƒtƒ@ƒCƒ‹B

I use jEdit [link] to restore the Japanese text as follows.

Open the file in jEdit and you will be see the following warning advising you to try a different encoding.

jEdit shows incorrect encoding warning

Close the warning and select File>”Reload with Encoding” and then select Shift_JIS from the listed encodings. You will have to select “More” a few times to display more encoding choices until Shift_JIS appears in the list

Shift_JIS is a popular Japanese character encoding.

Reload with encoding Shift_JIS

The original Japanese text is restored.

Mikoto2X


【概要】

Metasequoia と Mikoto を使って作ったモーション付き3Dモデルファイル(.mqo, .mkm)を
DirectX で使える形式(.x)に変換するプログラムです。

なお、Metasequoia 2.3.2、MetasequoiaLE R2.1、Mikoto 0.4f の使用を想定していますが、
それより新しいバージョンでも多分大丈夫でしょう。

Metasequpia http://www21.ocn.ne.jp/~mizno/metaseq/index.html
Mikoto  http://sasakingdom.com/mikoto.html


【内容】

Mikoto2X.exe  .mqo, .mkm -> .x コンバータ。
xsmooth.exe  Xファイルをスムージングするツール。変換元ファイルの修正に使用。
XAnimationMesh.exe Xファイルを表示するツール。変換後のファイルのプレビューに使用。
ASCII.png  XAnimationMesh.exeの付随物。
readme.txt  これ。
src/   上記のプログラムのソースコード。VC7.0・VC7.1 用。
sample/   下の説明で使うサンプルファイル。

You can set Shift_JIS to be one of the encodings that jEdit automatically tries whenever a document is opened if you will be opening old Japanese documents often.

See Help>”jEdit Help” for instructions.

So that Mojibake doesn’t occur again, save the document using the Unicode character set.

To do this in jEdit, click Utilities>”Buffer Options” to display the Buffer Options dialog and in the “Loading and Saving” pane change the character encoding to one of the Unicode character encodings such as UTF-8. Click OK to apply the change.

Change encoding to UTF-8

The encoding displayed in the Status Bar should change from Shift-JIS to UTF-8.

Encoding for current buffer is displayed in status bar

Save the document.

Now that the Japanese text has been restored you can copy and paste it into an online translator for translation.

The translation by Bing Translator is shown below.

Mikoto2X


[Overview]

That made Metasequoia and Mikoto with motion 3D model files (.mqo,.mkm)
Is a program to convert DirectX formats (.x ).

Although the intended using Metasequoia 2.3.2 MetasequoiaLE R2.1, Mikoto 0.4f
Would be okay and maybe even newer versions.

Metasequpia http://www21.ocn.ne.jp/~mizno/metaseq/index.html
Mikoto http://sasakingdom.com/mikoto.html


[Contents]

Mikoto2X.exe.mqo,.mkm->.x Converter.
tools to smooth the xsmooth.exe X file. Use the source file's modification.
Tool to display the XAnimationMesh.exe X file. Preview of the converted file to use.
ASCII.png XAnimationMesh.exe accompaniments.
Readme.txt this.
source code in src / above. For VC7.0 VC7.1.
sample files used in the description of the sample and below.


[Operating environment]
• Windows only:
-XAnimationMesh.exe DirectX9.0 since mandatory, otherwise the DirectX8.1 since mandatory


[I use]

sample folder has a file named kobito.m2x.
This to do a drag and drop to Mikoto2X.exe.
You can have a file named kobito.x.
Drag-and-drop this XAnimationMesh.exe and you can play.

Furthermore, in operations similar to the Metasequoia in the XAnimationMesh.exe can perspective changes,
In the up and down arrow keys can change the motion.


[Description]

Functions are quite limited.
Mikoto2X a bdef (skins), bone (bone), anchor (anchor)
It is only composed of only 3 types.
bdef synonym sdef (スフィリカルデ form).
morph (morphing), skin (スキンペーパ), select (object selector)
You cannot treat data.
Also, the number of skin should be a piece.

Keyframe interpolation is linear in the way is linear only, even if specified spline.
Just the spline may be reversible if holding out in the rehabilitation program.


To [make the necessary to convert files]

Kobito.m2x passed Mikoto2X in the previous example is
Specify the set of files used for the conversion.
To do the conversion in Mikoto2X.m2x file and
You need to provide a file specified in the.

contents of the Kobito.m2x is a text similar to the following.

mqo kobito.mqo
MKM kobito.mkm
init kobito_init.mkm
skin kobito_skin.x
bone kobito_bone.x
anchor kobito_anchor.x
out kobito.x

The left column represents the file type and file name specifies the right column.
Copy this file when converting a file made by myself
Please use the right column.

Out of the above out(kobito.x) non-file is the source file.
Must complete all translation source files are not possible.
(all available in the sample folder)
out is the output file name.

6 pieces in total, making is so hard, but is essential on two (mqo and mkm), just
The rest four is derived from it.
I'd actually get enough information in only two files,
read the mqo file into decent was cumbersome, so
It is only paid on Metasequoia and Mikoto do the processing part.

Is the source file for details.

-Mqo (kobito.mqo)
File set that definitions of skin, bones, anchor.
Created with Metasequoia.
Mikoto to load the actual file also.

-Mkm (kobito.mkm)
Files that define the movement of the bones.
Created by Mikoto.

-Init (kobito_init.mkm)
Files defined the initial position of the bone and initial stance.
read the mqo to Mikoto, create a new empty motion ( moderate bone.
Creates new click ) what was preserved intact.

-Skin (kobito_skin.x)
extract parts of skin definitions from a mqo file X file-based one.
Created with Metasequoia.
(1 x set magnification size when you save)
Metasequoia produced directly with problems may occur, however, because
Keep smooth advance.
(Drag and drop the X-files to the xsmooth.exe in the Mikoto2X.zip and
You can smooth. )

-Bone (kobito_bone.x)
extract parts of bones definition from a mqo file X file-based one.
Created with Metasequoia.
(1 x set magnification size when you save)

-Anchor (kobito_anchor.x)
extract part of the anchor definitions from a mqo file X file-based one.
Created with Metasequoia.
(1 x set magnification size when you save)

You can create m2x files such as six and above
Only after dropping to Mikoto2X.exe m2x.

By the way, do not register the Metasequoia and cannot output of the X-files
So if MetasequoiaLE can be made with Metasequoia mqo files
If you do convert X file in the MetasequoiaLE
You need without paying the money. The Nice ( )
The mqo file Material block ago loading in the LE in
you need to remove the "shader (3) to specify the shader description.
(Metasequoia 2.3.2, MetasequoiaLE R2.1 if)


About the [source code]

The source code is in src.
Use freely, however at your own risk thank you.

About Mikoto2X is the original source (created VC7.0)
To be able to compile, so could not compile with VC7.1 VC7.1
Have also rewritten a bit.
If you want to rewrite the Mikoto2X by using your.


[Finally]

For damages caused by using the program assumes no responsibility authors ( ikko ).
Comments or questions to imaginary-part@mizuho.plala.or.jp.


If you have Mojibake in a program's menus or dialogs the Mojibake needs to be changed in the binary file ( *.dll or *.exe).

If you are lucky you can change the text with a resource editor or PE File editor but sometimes the text is not in the resource section.

The next option is to use a hex editor.

The hex editor to use is MadEdit [link].

It can display the data as Shift-JIS (Windows codepage CP932) text via the View>Encoding menu whereas most other Hex Editors only display as ASCII text.

If you see something that looks like Japanese text you can copy it and translate in an online translator.

Sometimes you can use the Character Map in Windows (set to Western European) to get the sequence of byte values of the Mojibake characters and then search the file in the hex editor for that sequence.

If you replace the text with a translation you must start the text at the exact same place and finish it at the exact same place as the original text. The text must always have a byte value of 00 hex after it.

And as always when editing a file in a hex editor make sure you have a backup copy of the original in case something goes wrong since it is easy to corrupt the file.


No comments:

Post a Comment