[Mono-list] Japanese text question
Tiaan
tagdev at gmail.com
Wed Nov 11 20:27:47 EST 2009
You could look into using the String.Normalize method, but you would need to use different Unicode code-points for the special characters (or do a simple translation before the actual conversion). For example...
"\u30C8\u3099".Normalize(System.Text.NormalizationForm.FormC)
would produce ド (U+30C9) from ト゛ (that is, for U+30C8,U+309B where U+3099 is used instead of U+309B, resulting in the initial two-letter U+30C8,U+3099 sequence used as source for the translation).
For the reverse translations you can do something like...
"\u30C9".Normalize(System.Text.NormalizationForm.FormD)
which would produce the two-character "\u30C8\u3099" sequence -- so use this to determine the appropriate Unicode code-points to initially substitute for ten-ten, maru, etc.
By the way, the same String.Normalize method can, for example, be used to remove diacritics from European text, and this also seems to work for the Japanese dakuten and glides.
Hope this helps.
--Tiaan.
-----Original Message-----
From: mono-list-bounces at lists.ximian.com [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Stifu
Sent: 11 November 2009 11:12 AM
To: mono-list at lists.ximian.com
Subject: [Mono-list] Japanese text question
Hello,
I'd like to know if there is a simple way to connect the ten ten (゛) and
maru (°) characters with the preceding character, ie: just how it's supposed
to look.
For example, this text:
ト゛ー...
Should look like that after conversion:
ドー...
I naturally looked into the string and CultureInfo methods, but found
nothing.
If no magic solution shows up, I guess I'll have to do everything myself,
like: if (character == '゛') switch(previous_character)...
Can anyone help? (Mr. Atsushi, perhaps?)
--
View this message in context: http://old.nabble.com/Japanese-text-question-tp26304938p26304938.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist - Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
More information about the Mono-list
mailing list