Author Topic: Compile 32-bit WeiDU using OCaml 4.07.0 or above to enable unicode support  (Read 1222 times)

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
Hi,

Right now, the 64-bit version of WeiDU can display Unicode characters inside the console while the 32-bit is not. After a lite investigation, turns out that the reason for this is because The 32-bit executable has been compiled with OCaml 4.05.0 and the Unicode support was added in 4.06 - https://github.com/ocaml/ocaml/issues/10436

I have successfully compiled the 32-bit WeiDU using '4.07.0+default-unsafe-string+mingw32' (this is the only unsafe-string variant that comes out-of-the-box) and the Unicode support is working:

https://user-images.githubusercontent.com/365255/121081536-23f6aa80-c7dd-11eb-8c68-21bd2b76ca32.png

Can you please update the OCalm version for 32-bit so modders can accept translations of the component names that contain Unicode characters?
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Hell yes, please :)

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Update my build environment, you say. I'll have a look, but I build 32-bit on a Win XP system and it imposes some limitations.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Okay, a bit of a snag: I do not appear to be able to update my environment on Windows XP. Maybe I'm being stupid or maybe the OS is just too old. I have another 32-bit build path on my Windows 10 system, but the resulting executables will not run on ye olde Windows XP. Does anyone have any suggestions? I suppose I could provide both 32-bit executables, but the Windows-XP one wouldn't have this feature and the other 32-bit binary might have more limited compatibility.

I have updated the release for 247 with executables from the new build path and would be thankful if interested people tested them on their systems to verify that they function as expected.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
WeiDU-Windows-247-x86+win10+4.07.1 works!

https://i.imgur.com/G7uk1WH.png

Providing a separate WeiDU-XP-Support binary could work even if Windows XP has less than 1.2% of global marketshare.

Do you use VM of Windows XP for compiling? I can try to build 32-bit from scratch and if successful, I could transfer this VM to you.
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
If you want, that would be cool. I do use a VM, yes. Providing a single "universal" executable would arguably be better than two different ones that are not even equivalent (considering the differences introduced by the different versions of OCaml).

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
I was not able to compile WeiDU on XP using the '4.07.x' version because apparently, OCaml no longer supports XP. The minimum OS is now Windows Vista. Yet, there is hope: https://discuss.ocaml.org/t/8208

Basically, there is a way to have WeiDU binary working on XP:

- by using single 'win32.c patch' and compiling OCaml on Windows 10: this will make OCaml produce binaries that run on Windows XP
- by using both flexdll patch' and 'win32.c patch' then 'bootstrap flexdll' before compiling OCaml on Windows XP: this makes OCaml compilation possible on Windows XP and will make OCaml produce binaries that run on Windows XP

I tried but I have not found a way to apply 'win32.c patch' to the 'ocaml setup' produced by standard OCaml tools aka 'opam switch create 4.07.0+default-unsafe-string+mingw32'.

Still, I think that the 'win32.c patch' might be useful to your current setup so I'm posting my findings.
« Last Edit: November 05, 2021, 07:26:20 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Thank you for your effort. I'll probably just not build an XP-compatible WeiDU and see if anyone notices.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: