after updating to a new version - Russian language doesn't supported if it presents in plugin.
It looks like: instead of Russian letters questions ????
I tried different encodings: UTF-8, UTF-8 (without BOM), ANSI etc....
On previous version - all works fine.
[DOUBLEPOST=1432251149][/DOUBLEPOST]Here is example for testing.
Fixed UTF-8 encoding not working for C# plugins
Discussion in 'Rust Discussion' started by ViTaliY_VS, May 22, 2015.
-
Attached Files:
Last edited by a moderator: May 22, 2015 -
-
Wulf Community Admin
Where are the letters now showing? I've tested the in-game Rust chat and the messages show fine for me. I run a plugin just to test other languages.
-
Console messages works fine. But if it present in plugin it looks like �������������������
[DOUBLEPOST=1432252575][/DOUBLEPOST]Load attached plugin. Set env.time to 17:59 and you'll see.
[DOUBLEPOST=1432252878][/DOUBLEPOST] -
Wulf Community Admin
Code:PLUGIN.Title = "Auto Message" PLUGIN.Version = V(0, 1, 0) PLUGIN.Description = "" PLUGIN.Author = "Wulfspider" PLUGIN.HasConfig = truelocal debug = falselocal broadcastTimer function PLUGIN:Init() self:LoadDefaultConfig() endfunction PLUGIN:OnServerInitialized() broadcastTimer = timer.Repeat(10, 0, function() rust.BroadcastChat("<color=#fa5>" .. self.Config.Settings.ChatName .. "</color>", self.Config.Messages.Broadcast) end, self.Plugin) endfunction PLUGIN:LoadDefaultConfig() self.Config.Settings = self.Config.Settings or {} self.Config.Settings.ChatName = self.Config.Settings.ChatName or "SERVER" self.Config.Messages = self.Config.Messages or {} self.Config.Messages.Broadcast = self.Config.Messages.Broadcast or "Всем привет" self:SaveConfig() end
-
PrintToChat
SendReply
Problem only c#
lua is fine -
Yes, i confirm this problem.
Default encoding is not the best choice, imho. Default encoding may differ and this is what causing the problem.
PluginCompiler.cs
Code:var sourceFiles = compilation.plugins.SelectMany(plugin => plugin.IncludePaths).Select(includePath => new CompilerFile { Name = Path.GetFileName(includePath), Data = File.ReadAllBytes(includePath) }).ToList(); sourceFiles.AddRange(compilation.plugins.Select(plugin => new CompilerFile { Name = plugin.ScriptName + ".cs", Data = Encoding.Default.GetBytes(string.Join(Environment.NewLine, plugin.ScriptLines)) }));
-
Please share compiled DLL.
[DOUBLEPOST=1432291417][/DOUBLEPOST] -
I have fixed that, dudes
-
Can confirm this issue. Must rollback to old oxide version for now. This happens in .cs plugins what used SendReply function. Edit: or maybe everywhere, not sure, but file actually utf8.
[DOUBLEPOST=1432309380][/DOUBLEPOST]Ok, i "fixed" it by replacing
Code:Data = Encoding.Default.GetBytes(string.Join(Environment.NewLine, plugin.ScriptLines))
Code:Data = File.ReadAllBytes(plugin.ScriptPath)
Last edited by a moderator: May 22, 2015 -
Oh, god. Why..
Just replace
Code:Encoding.Default.GetBytes
Code:Encoding.UTF8.GetBytes
p.s Who can't do this - just wait for an update. This should be fixed very soon. -
Wulf Community Admin
-
ps i just was too lazy to google what paramethers have "Encoding" library.