Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Charset of Textitem

Explorer ,
Jul 01, 2018 Jul 01, 2018

Hi,

We have a PHP and MYSQL system which generates a JSX file for design.

It pulls one value out of the database and via php to the jsx file.

We have an issue with some characters which are set in the UTF8 charset, which are correctly displayed in the database and in PHP and HTML.

But when set in photoshop code, it causes issues and displays them incorrectly.

For example

activeDocument.activeLayer.textItem.contents="""' . $rs_item['slogan_name'] . '"""; 

Du ser mig kun for det tøj jeg har på

This displays correctly in php, mysql etc, but when set in photoshop it displays to:

Du ser mig kun for det tøj jeg har på

Is there a way to set a charset for a value for photoshop?

I tried

activeDocument.activeLayer.textItem.encoding = "UTF8";

but i dont think there is such a value for textitem?

Thanks

TOPICS
Actions and scripting
4.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Jul 20, 2018 Jul 20, 2018

You here gave an example of your PHP script.

if($_SESSION['admin_name']!=="Admin") { 

// CLOSE THE TEMPLATE PSD AND OPEN THE ACTUAL DESIGN IN PSD 

$design_code .= ' 

 

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   

var fileRef = "' . "/z/DESIGN_SERVER/" . $savefilename . ".psd" . '";   

app.open( new File( fileRef ) );  

'; 

} else { 

// CLOSE THE TEMPLATE PSD AND OPEN THE ACTUAL DESIGN PDF 

$design_code .= ' 

 

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   

var fileRef =

...
Translate
Adobe
People's Champ ,
Jul 20, 2018 Jul 20, 2018

You here gave an example of your PHP script.

if($_SESSION['admin_name']!=="Admin") { 

// CLOSE THE TEMPLATE PSD AND OPEN THE ACTUAL DESIGN IN PSD 

$design_code .= ' 

 

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   

var fileRef = "' . "/z/DESIGN_SERVER/" . $savefilename . ".psd" . '";   

app.open( new File( fileRef ) );  

'; 

} else { 

// CLOSE THE TEMPLATE PSD AND OPEN THE ACTUAL DESIGN PDF 

$design_code .= ' 

 

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   

var fileRef = "' . "/z/DESIGN_SERVER/" . $savefilename . ".pdf" . '";   

app.open( new File( fileRef ) );  

'; 

So that's it.

Although I do not know PHP, I can advise you to change the code like this so that the first characters in the $ design_code variable are always UTF8 BOM (three invisible byte characters).

// set UTF8 BOM at the brgining of the $design_code variable

$design_code = chr(239) . chr(187) . chr(191);

if($_SESSION['admin_name']!=="Admin") { 

// CLOSE THE TEMPLATE PSD AND OPEN THE ACTUAL DESIGN IN PSD 

$design_code .= ' 

 

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   

var fileRef = "' . "/z/DESIGN_SERVER/" . $savefilename . ".psd" . '";   

app.open( new File( fileRef ) );  

'; 

} else { 

// CLOSE THE TEMPLATE PSD AND OPEN THE ACTUAL DESIGN PDF 

$design_code .= ' 

 

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);   

var fileRef = "' . "/z/DESIGN_SERVER/" . $savefilename . ".pdf" . '";   

app.open( new File( fileRef ) );  

'; 

P.S. Good luck

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 20, 2018 Jul 20, 2018
LATEST

$design_code = chr(239) . chr(187) . chr(191); 

this fixed it. Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines