Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Unicode character conversion  (Read 1730 times)

0 Members and 1 Guest are viewing this topic.
Unicode character conversion
« on: January 12, 2011, 07:54:50 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3374
So I've been writing a text engine in GM that I want to support multiple languages, specifically japanese characters. Unfortunately GM doesn't support unicode at all so pasting them into the code that converts the text into subimage numbers for the font sprite doesn't work. I've thought of a way around this by using something that converts a string of japanese characters to the standard set used by GM, so for example "こんにちは" would become "j$tow" or whatever roman character/symbol represents the character. However due to the non unicodiness of GM it's kinda impossible for me to make a program that uses a table to convert one to the other :P
I guess it could probably be done with an excel so I'm gonna give it a go in a minute, but if I have no luck would someone be able to write a little program that does it?
Logged
Quote from: Jason
Your community is a bunch of stuck up turds.
Re: Unicode character conversion
« Reply #1 on: January 12, 2011, 09:22:33 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3374
Nevermind, figured out how to write an excel sheet to do it :P
Logged
Quote from: Jason
Your community is a bunch of stuck up turds.
Re: Unicode character conversion
« Reply #2 on: January 12, 2011, 06:22:19 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Just being curious. How did you solve it?
Logged
Re: Unicode character conversion
« Reply #3 on: January 12, 2011, 11:21:32 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3374
Here's the spreadsheet, http://frostfireaudio.com/junk/text%20converter.xlsx . Pretty messy but it works. Annoyingly substitute() doesn't let you select ranges of cells so I had to do one call for each character.
Logged
Quote from: Jason
Your community is a bunch of stuck up turds.
Re: Unicode character conversion
« Reply #4 on: January 23, 2011, 09:54:10 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
Does this also deal with katakana and smaller characters (words like ひゃく and にっぽん for example)?

Logged



i love big weenies and i cannot lie
Re: Unicode character conversion
« Reply #5 on: January 24, 2011, 01:16:22 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3374
Yeah, I've added the small characters to the sheet but not katakana yet. I will do that though, the way it's set up you can use any language/character set that contains 253 characters or less, which is why I can use this method for japanese characters as long as I don't start using kanji. Which isn't necessary anyway since you can write any of them with hiragana.
Logged
Quote from: Jason
Your community is a bunch of stuck up turds.
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.183 seconds with 49 queries.

anything