I have a problem with my project.
I have a js function sig7 which generates me hash.
But the charset of html page is required to be utf-8.
I try to execute this js in my C# app with library
Everything is OK, but generated hash is not valid. I think it happens because the charset of code isn’t utf-8.
My app:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Noesis.Javascript;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader sr = new StreamReader("c://lib.js");
string script = sr.ReadToEnd();
JavascriptContext context = new JavascriptContext();
context.Run(script);
var sig = context.Run(@"sig7('057d194dd856d4f8cd15bc85fbbddbf136df809f72f5a435e6af41c1f82f950f,Id166084073,ldsclldscl');").ToString();
richTextBox1.Text = sig;
}
}
}
sig must be 1dbde1d62b6e0dca7d56f72e50c178132e236978d2dba1e2c3ada5b7b8973aeb but not 7211ed8fe85d750c26cb5abb499bfa88b7cecbe968fc6cc7efa69dc496c8ae12 which is generated by my app.
Any help?
Should this line:
Be:
?