Skip to content

This repository contains the sample that shows how to to avoid argument exception while appending the Euro € symbol to EditControl.

SyncfusionExamples/How-to-avoid-argument-exception-while-appending-the-Euro-symbol-to-EditControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to avoid argument exception while appending the Euro symbol to EditControl

This repository contains the sample that shows how to avoid argument exception while appending the Euro € symbol to EditControl.

The SetEncoding method should be set to default type for encoding to load /assign the text value with equation or symbols.

// Set encoding 
this.editControl2.SetEncoding(Encoding.Default);
this.editControl2.Text = "£££";
Me.editControl2.SetEncoding(Encoding.Default)
Me.editControl2.Text = "£££"

When assigning the text using StreamReader, the encoding can be set as like below.

string inputPath = @"../../TextFile1.txt";
string outputPath = @"../../TextFile2.txt";


var fs = new FileStream(inputPath, FileMode.Open, FileAccess.Read,
FileShare.ReadWrite | FileShare.Delete);
string content;
using (StreamReader reader = new StreamReader(fs, Encoding.Default))
{
content = reader.ReadToEnd();
}

File.WriteAllText(outputPath, content, Encoding.Default);
this.editControl2.Text = content;
Dim inputPath As String = "../../TextFile1.txt"
Dim outputPath As String = "../../TextFile2.txt"

Dim fs = New FileStream(inputPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite Or FileShare.Delete)
Dim content As String
Using reader As New StreamReader(fs, Encoding.Default)
content = reader.ReadToEnd()
End Using

File.WriteAllText(outputPath, content, Encoding.Default)
Me.editControl2.Text = content

Output:

EditControl_Encoding

About

This repository contains the sample that shows how to to avoid argument exception while appending the Euro € symbol to EditControl.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •