This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TOOL] Spell Editor GUI  (Read 7693 times)

hyakkimaru

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 128
    • View Profile
    • http://mc-revolution.fr
Re: [TOOL] Spell Editor GUI
« Reply #15 on: September 13, 2013, 07:13:12 pm »
Here is my french DBC, if it can help you...

http://forum.shadow-storm.fr/Spell.dbc
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #16 on: September 13, 2013, 07:23:11 pm »
Quote from: "hyakkimaru"
Here is my french DBC, if it can help you...

http://forum.shadow-storm.fr/Spell.dbc

Just tested it:



Appears to be working, though I am not 100% sure how the character set works. If I am correct in how I think, then the bad characters in my screenshot is because I am using a English computer, and if you were using a French computer it would display fine (?).

If not, I need to find a way to change to a different character set dependant on locale loaded.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

hyakkimaru

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 128
    • View Profile
    • http://mc-revolution.fr
Re: [TOOL] Spell Editor GUI
« Reply #17 on: September 13, 2013, 07:41:19 pm »
I have tested on my computer and it's the same problem, characters are not supported... Where is UTF-8 when we need him  :lol:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #18 on: September 13, 2013, 08:12:52 pm »
It would not. The use encoding is utf8, while you seem to be using some 8859 or alike.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #19 on: September 13, 2013, 08:14:43 pm »
Quote from: "hyakkimaru"
I have tested on my computer and it's the same problem, characters are not supported... Where is UTF-8 when we need him  :lol:

Can you test this version for me? https://dl.dropboxusercontent.com/u/110 ... chTest.exe

I tried converting the string to UTF8 but it just displays as '???' for those characters on my computer.

If this doesn't work for me, I will have to give up without help. I have no idea what I am doing. ^^

Calling:
Code: [Select]
SpellDBC.Local2D_String = Encoding.UTF8.GetString(UTF8Encoding.Convert(System.Text.Encoding.ASCII, System.Text.Encoding.UTF8, System.Text.Encoding.Default.GetBytes(dict.Item(SpellDBC.Local2D))))
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

hyakkimaru

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 128
    • View Profile
    • http://mc-revolution.fr
Re: [TOOL] Spell Editor GUI
« Reply #20 on: September 13, 2013, 08:35:03 pm »
Same problem, my characters are changed into "???"
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #21 on: September 13, 2013, 09:41:14 pm »
Well then, I guess it's term to hail the glorious English master-language.

Jokes aside, I don't know how to fix this. I understand it should be UTF8 but I do not know how to convert it to this format.

According to google my strings should be using UTF-16 (UNICODE).

When I convert from UNICODE to UTF8 it outputs:
Code: [Select]
畔⁥湩瑳湡慴썮涩湥⁴慬挠扩敬‮㼿獥썰犨⁥畱⁥潶獵瘠畯⁳敳瑮穥戠敩慤獮瘠瑯敲瀠慥⁵慭湩整慮瑮⸮.

This doesn't seem right either.

So I am giving up for now until someone can give me more information on where I could be going wrong. :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

hyakkimaru

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 128
    • View Profile
    • http://mc-revolution.fr
Re: [TOOL] Spell Editor GUI
« Reply #22 on: September 13, 2013, 11:03:13 pm »
I'm not sure but I think you can try with UTF8 or latin1 :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

noc

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 121
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #23 on: September 13, 2013, 11:30:57 pm »
and to Win-1252?

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #24 on: September 14, 2013, 04:59:15 am »
Code: [Select]
Encoding.UTF8.GetString
  (UTF8Encoding.Convert
    ( System.Text.Encoding.ASCII
    , System.Text.Encoding.UTF8
    , System.Text.Encoding.Default.GetBytes (offset)
    )
  )
The problem is the "convert".
System.Text.Encoding.Default is some ANSI encoding of your system, thus a not really well defined value.
Then, you're converting from ANSI (?), hard-reinterpreting it as ASCII, to UTF8. That's just non-sense. All it may do is filtering non-ASCII-characters, which is why you're seeing question marks.

You should do
Code: [Select]
System.Text.Encoding.UTF8.GetString (System.Text.Encoding.UTF8.GetBytes (offset))and everything should be fine.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [TOOL] Spell Editor GUI
« Reply #25 on: September 14, 2013, 02:22:36 pm »
Quote from: "schlumpf"
Code: [Select]
Encoding.UTF8.GetString
  (UTF8Encoding.Convert
    ( System.Text.Encoding.ASCII
    , System.Text.Encoding.UTF8
    , System.Text.Encoding.Default.GetBytes (offset)
    )
  )
The problem is the "convert".
System.Text.Encoding.Default is some ANSI encoding of your system, thus a not really well defined value.
Then, you're converting from ANSI (?), hard-reinterpreting it as ASCII, to UTF8. That's just non-sense. All it may do is filtering non-ASCII-characters, which is why you're seeing question marks.

You should do
Code: [Select]
System.Text.Encoding.UTF8.GetString (System.Text.Encoding.UTF8.GetBytes (offset))and everything should be fine.

Thank you, the changes suggested appear to work.

Committed to GitHub, updated the dropbox link. The new version should work. :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »