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

special Character encoding issue

Explorer ,
Dec 16, 2019 Dec 16, 2019

Copy link to clipboard

Copied

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

Views

749

Translate

Translate

Report

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 )

Votes

Translate

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

Copy link to clipboard

Copied

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

 

myLog.encoding = "UTF-8";

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

You saved my day. Thanks a lot.

Votes

Translate

Translate

Report

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