Some Unicode versions contain the file ucd/UnicodeData.txt. It describes many characters with fixed fields postfixed with a ; (semicolon). Basically it follows the format:

<code-point>;<name>;<gc>;more fields...

I need a tool for capturing the GC of every single Unicode character (from U+0000 to U+10FFFF) into an ECMAScript string literal. The purpose of using a String literal is expressiviness, but it'll work exactly as a vector of shorts. E.g., every code unit will tell the GC of a character in the correct index. Index 10 of this string will be GC of U+000A.


This String describes U+0000 and U+0001 as Lu (uppercase letters).

So, what I need: translate Unicode 5.1.0 UnicodeData.txt into a GC string, exactly like this little example above, but completely. Anyone with a performace device for that? ;)

  • Perhaps it's me, but I don't understand what you're asking. How does a string consisting of two spaces describe two control characters as uppercase letters?What are you trying to accomplish here? Please edit your question to clarify your intent. – Jeff Zeitlin Mar 31 '18 at 9:36
  • @JeffZeitlin I've edited the question. Basically, it's just an (wrong) example. 0x20 can be a value from an enumeration, supposing enum UnicodeType.Lu = 32. Personally I need to control the values of this enum, maybe through source code. – Klaider Mar 31 '18 at 10:36
  • You should either correct or delete the example. Also, by specifying an ECMAScript string, you're implying that you intend to use this in ES code, which probably means that it ends up off-topic here, and not suitable as written for Stack Overflow. You will probably have to write your own code to parse the file - which shouldn't be difficult; if I wanted the same thing in PowerShell, it'd be a one-liner, because it's structurally compatible with a CSV file. – Jeff Zeitlin Mar 31 '18 at 10:46
  • @JeffZeitlin I found it easier to put an example just to demonstrate what I want, even if it specifies GCs for characters wrongly (#x00 and #x01). Yeah, I was writting a UnicodeData.txt scanner at my laptop, but my brother is now using it to play a game, so it's hard to send my code back to the cellphone. In fact I just want this to parse AS3 in AS3, but I've got to do it in Node.JS for executing it in Android firstly (using Dory.JS). Thanks for the comments anyways :). – Klaider Mar 31 '18 at 10:54
  • @JeffZeitlin I kinda also forgot to say it won't be easy to get UnicodeData.txt into this cellphone, but maybe the unique way is to use the laptop for that. I've even got a new idea: I can write the GC compiler in Android temporarily and run it in my laptop later for catching extra time until the day of free laptop ( that means, w/o my brother using it to play a game) comes again. – Klaider Mar 31 '18 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.