"Specified charset is not supported." Error on the File Server sample

+1 vote
asked Nov 15, 2015 by Dennis Jung (130 points)
edited Nov 16, 2015 by Tomas Knopp

Hello,

I'm considering Rebex File Server to make C/S application.
But I can't run your sample(FileServer_CS) project with a problem.
The Exception of "Specified charset is not supported" occurred on constructor of FileServer.
I couldn't find the way to set the charset before the constructor line.

My system environment is..
Windows 7 Professional Service Pack 1 64-bit
Using Korean(korea) - Microsoft IME

Error line is...

_server = new FileServer();

Stack Trace is...

   at Rebex.Net.Servers.FileServerSettings.set_ShellEncoding(Encoding value)
   at Rebex.Net.Servers.FileServerSettings..ctor(FileServer A)
   at Rebex.Net.Servers.FileServer..ctor()
   at Rebex.Samples.MainForm..ctor() in C:\Rebex\Samples\Server\vs2010-net-4.0\FileServer\FileServerWinForm_CS\MainForm.cs:line 79
   at Rebex.Samples.Program.Main() in C:\Rebex\Samples\Server\vs2010-net-4.0\FileServer\FileServerWinForm_CS\Program.cs:line 39
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Applies to: File Server
commented Jan 12, 2016 by Tomas Knopp (58,580 points)
This has been fixed in release 2016R1 of Rebex components.

1 Answer

0 votes
answered Nov 16, 2015 by Tomas Knopp (58,580 points)
edited Jan 12, 2016 by Tomas Knopp

Update: This bug has been fixed in Rebex File Server 2016 R1. The File Server SftpEncoding now defaults to UTF-8 on machines where default charset was multi-byte but not UTF-8.


Hello,

the problem is that the FileServer constructor sets the ShellEncoding to Encoding.Default, which is a Korean encoding.

However, currently only single-byte encodings are supported by the FileServer.Settings.ShellEncoding and FileServer.Settings.SftpEncoding.

At the same time your system's Encoding.Default is multi-byte which is standard for Korean which results in the error that you are getting.

As a quick fix before we get an official solution, I added the possibility for you to specify a different DefaultShellEncoding as a static property on the FileServer class.

Please download the hotfix and give it a try with UTF8 like this:

FileServer.DefaultShellEncoding = Encoding.UTF8;
FileServer server = new FileServer();

// etc.

Let me know whether the File Server sample now runs for you.

commented Nov 16, 2015 by Dennis Jung (130 points)
Thank you very much indeed!

The file server sample now runs well for me. :)

Thank you for your prompt response again!
commented Nov 16, 2015 by Tomas Knopp (58,580 points)
Thanks for letting me know I am glad it works now :)
commented Dec 29, 2015 by Dennis Jung (130 points)
Hi Tomas Knopp.
Finally I bought your File Server and SFTP Client.
But I can't use this hot fix.
Because I don't know how i can set licenseKey like below.
Rebex.Licensing.Key = "==XXXXXXXXXXXXX=="
Let me know how i can set the licensing.Key.
If i've already recieved my licenseKey Let me know that.
I have to do presentation in 36 hours with demo application.
Please help me again.
Thanks!
commented Dec 29, 2015 by Lukas Pokorny (85,170 points)
Hello, I sent a link to full versions of Rebex File Server and Rebex SFTP to your e-mail. Please use these instead of the trial version. You don't have to set any licensing key with the full version.
commented Dec 30, 2015 by Dennis Jung (130 points)
Thank you for your prompt response! :)
I'm always happy with your quick response and hot fix.
The source code you gave me works well in my case.
...