Skip to main content
John_Kordas
Inspiring
August 20, 2010
Answered

JS Display international characters

  • August 20, 2010
  • 2 replies
  • 4633 views

I've recently posted a script that makes a font catalogue.  One of the comments I got was if it could display international characters Russian for example. Would anyone have any suggestion as to how I might go about this?  I've got a couple of changes I need to make to the script and it would be good to include this request as well.

Cheers.

This topic has been closed for replies.
Correct answer Kasyan Servetsky

Thanks Marc and Kaysan,

For some reason Kaysan I get an error message telling

Error Number: 30474

Error String: 'local' is a read only property.

Line:1

Source: app.locale='ru';

Marc I'm looking through your snippet as we speak, much appreciated to you both.

Cheers, John.


John,

I am sorry — my memory let me down , it should have been:

$.locale = 'ru';

Kasyan

2 replies

Jongware
Community Expert
Community Expert
August 20, 2010

To insert any other character into Javascript strings than plain A..Z, you can always safely use Unicode notation. You need to look up the Unicode values of the characters you want to insert, but fortunately InDesign can help you with that: the Glyphs panel shows the Unicode value for any character if you hover the mouse over it, andyou can copy some text from the web, paste it into InDesign, then select each character in turn and check the Info panel.

Insert the Unicode values into your javascript string like this: "\u0000" where the zeros should be replaced with all four Unicode digits in hex notation (which is nothing more complicated than "that's exactly what InDesign is showing you in the Info panel").

For instance, "Jongware" appears on Russian web sites as something like this: Дзонгшаре

As a Javascript string this would be "\u0414\u0437\u043e\u043d\u0433\u0448\u0430\u0440\u0435".

Kasyan Servetsky
Legend
August 20, 2010

For instance, "Jongware" appears on Russian web sites as something like this: Дзонгшаре

No, it should be either Джонгваре (transcription) or Джонгвэа (transliteration).

As to Unicode notation, theres no need to use it with CS3/4/5 — I just type text in Russian and it works perfectly. You have to add Russian in Input Menu (Mac) or in Languages and Regional Settings Panel (Windows) for this.

The only issue I know about are Submenus: never name them in Russian on Mac.

Kasyan

Jongware
Community Expert
Community Expert
August 20, 2010

Hi Kasyan! You are correct: I couldn't find my example anymore because I didn't recall in which discussion I was mentioned With your transcription I found it again -- "... а точнееп понять все то, что изложено на Джонгваре..."

tomaxxi
Inspiring
August 20, 2010

Hey!

Make it work in InDesign CS5

--

tomaxxi

http://indisnip.wordpress.com/

John_Kordas
Inspiring
August 20, 2010

Hi tomaxxi

I've tried it in CS5 and it works fine.  The changes I need to make are for CS3.  So if it works in CS5 internationl characters are ok?

tomaxxi
Inspiring
August 20, 2010

When I start the script this error shows up:

I'm using Win7 64-bit / InDesign CS5 US English

--

tomaxxi

http://indisnip.wordpress.com/