News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: A Question about UTF-16 LE  (Read 2751 times)

Nyxos

  • Jr. Member
  • **
  • Posts: 13
  • ~ouisu!
    • View Profile
A Question about UTF-16 LE
« on: May 30, 2013, 10:56:30 pm »
I know that this may seem to be a insane question since UTF-16 stores text as surrogate pairs xD, Is there in any such way that we can translate a file which has a LBA measure (meaning no changes to the filesize). I know that this is insane but UTF-16 stores the letter A as (00 41) which is crazy meaning one UTF-16 character is equal to a single ASCII character in size.
"A horrendous monstrosity has forced its way into existence, and we are, as a species, worse for it"

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: A Question about UTF-16 LE
« Reply #1 on: May 31, 2013, 03:55:29 am »
I don't really understand what your actual question is, but if you want to know whether you can reduce the space needed by the text, then yes. However, you'll have to reprogram parts of the game's text decoding routines.

But first you might rather want to look for a way to change the file's size instead. This should be possible almost always.

Nyxos

  • Jr. Member
  • **
  • Posts: 13
  • ~ouisu!
    • View Profile
Re: A Question about UTF-16 LE
« Reply #2 on: May 31, 2013, 04:59:49 am »
I don't really understand what your actual question is, but if you want to know whether you can reduce the space needed by the text, then yes. However, you'll have to reprogram parts of the game's text decoding routines.

But first you might rather want to look for a way to change the file's size instead. This should be possible almost always.

Exactly as you said, my problem really is the LBA measure and I am finding a way on how to alter it. To be more specific its the PSP's LBA routine, since an EBOOT.BIN is not allowed to change in size. In a way that you mean, "decoding routine" meaning the font used or the process on how the main executable reads the text?
"A horrendous monstrosity has forced its way into existence, and we are, as a species, worse for it"

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: A Question about UTF-16 LE
« Reply #3 on: May 31, 2013, 11:26:57 am »
since an EBOOT.BIN is not allowed to change in size.

Of course it can change. Look up a tutorial on ELF files and PSP relocatable sections. Other than that, it's just a normal file.

Quote
the process on how the main executable reads the text?

This. Just locate to what address the text gets loaded into RAM and set a write break point on that location. For UTF-16 (it's probably rather UCS2) it's probably using the assembly instruction "lhu ..." and later adding 2 to some offset. Change that to "lbu ..." and only add 1 to the offset. Depending on how the game is written, that might be all there is to it. If you have no idea what I'm talking about it's probably too early for you and you should read up on assembly programming.

Nyxos

  • Jr. Member
  • **
  • Posts: 13
  • ~ouisu!
    • View Profile
Re: A Question about UTF-16 LE
« Reply #4 on: May 31, 2013, 02:06:43 pm »
Of course it can change. Look up a tutorial on ELF files and PSP relocatable sections. Other than that, it's just a normal file.

This. Just locate to what address the text gets loaded into RAM and set a write break point on that location. For UTF-16 (it's probably rather UCS2) it's probably using the assembly instruction "lhu ..." and later adding 2 to some offset. Change that to "lbu ..." and only add 1 to the offset. Depending on how the game is written, that might be all there is to it. If you have no idea what I'm talking about it's probably too early for you and you should read up on assembly programming.

Thank You. I will try all of those that you recommended to me.
"A horrendous monstrosity has forced its way into existence, and we are, as a species, worse for it"