New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #18895 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

spidermonkey: UTF-8 Support

Reported by: ruediger@… Owned by: macsforever2000@…
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: javascript, utf8, spidermonkey, flusspferd Cc: macsforever2000@…
Port: spidermonkey

Description

I'm trying to create a macport file for the  Flusspferd JavaScript library which depends on spidermonkey having UTF-8 support. Unfortunately spidermonkey is build without UTF-8 support and there is no variant to do so.

To build spidermonkey with UTF-8 support you have to set DEFINES to -DJS_C_STRINGS_ARE_UTF8

so something along those lines should do it:

variant utf8 description {add UTF-8 support} {
  build.args-append \
  DEFINES=-DJS_C_STRINGS_ARE_UTF8
}

Change History

Changed 3 years ago by macsforever2000@…

  • owner changed from macports-tickets@… to akitada@…

Changed 3 years ago by macsforever2000@…

Is there any reason not to always build it with UTF-8 support?

Changed 3 years ago by ruediger@…

Is there any reason not to always build it with UTF-8 support?

Non that I could think of.

Changed 3 years ago by macsforever2000@…

  • cc macsforever2000@… added

Cc Me!

Changed 3 years ago by ruediger@…

Is there any hope on getting this fixed?

Changed 3 years ago by macsforever2000@…

  • owner changed from akitada@… to macsforever2000@…
  • status changed from new to assigned

Maintainer timeout.

Changed 3 years ago by macsforever2000@…

  • status changed from assigned to closed
  • resolution set to fixed

Committed revision r48945.

Changed 3 years ago by macsforever2000@…

To be clear, I added UTF-8 support without a variant.

Changed 3 years ago by ruediger@…

Sorry the Patch doesn't seem to work. You can check if spidermonkey supports UTF-8 with the following Code

#include <js/jsapi.h>
#include <stdio.h>
int main() {
  if(JS_CStringsAreUTF8())
    puts("Spidermonkey supports UTF8");
  else
    puts("no UTF8 support");
}

gcc -pedantic -Wall -W -std=c99 -g3 testutf8.c -I/opt/local/include -L/opt/local/lib -ljs -DXP_UNIX

Maybe a better way would be to add the -DJS_C_STRINGS_ARE_UTF8 to the OS_CFLAGS on line 13 in source:trunk/dports/lang/spidermonkey/files/patch-config-Darwin.mk (if the patch is still applied)

Building Spidermonkey can be quite a pain in the ass :(.

Changed 3 years ago by macsforever2000@…

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 3 years ago by macsforever2000@…

  • status changed from reopened to closed
  • resolution set to fixed

Committed revision r49070. This works for me. Thanks!

Changed 3 years ago by ruediger@…

Works for me, too. Thank you!

Changed 3 years ago by anonymous

  • milestone Port Bugs deleted

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.