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

special Character encoding issue

Explorer ,
Dec 16, 2019 Dec 16, 2019

When i write log file (txt file) the spaeical character are conveted in to junk. How  do i resovle the issue

var filename = "Halír"

var filename = Hal�r

OS : MAC

Editor : visual studio

 

I have copied he method for your reference.

 

function WriteLog(myText, Filename) {
try {
var myLog = new File(Filename);

if (myLog.exists) {
myLog.open("e");
myLog.seek(0, 2);
} else {
myLog.open("w");
}
myLog.writeln(myText);
myLog.close();
} catch (e) {}
}

 

 

TOPICS
Scripting
927
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

Community Expert , Dec 16, 2019 Dec 16, 2019

Would it help to define the encoding of the log file as "UTF-8" ?

 

myLog.encoding = "UTF-8";

 

Regards,
Uwe Laubender

( ACP )

Translate
Community Expert ,
Dec 16, 2019 Dec 16, 2019

Would it help to define the encoding of the log file as "UTF-8" ?

 

myLog.encoding = "UTF-8";

 

Regards,
Uwe Laubender

( ACP )

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
Community Expert ,
Dec 16, 2019 Dec 16, 2019

No, as this is in source code (although the problematic example line does not appear in the example source), it's a problem in the code editor.

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 ,
Dec 16, 2019 Dec 16, 2019
LATEST

You saved my day. Thanks a lot.

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