1. 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.
     

    Attached Files:

    Last edited by a moderator: May 22, 2015
  2. Wulf

    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.

    552010898102fd50d7b60d15d2a5215c.png
     
  3. 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] 2015-05-22 03-04-08 Скриншот экрана.png
     
  4. Wulf

    Wulf Community Admin

    It sounds like the plugin isn't actually saved as UTF-8 then. This is the test plugin I use which was shown in my previous reply.
    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
     
  5. PrintToChat
    SendReply

    Problem only c#

    lua is fine
     
  6. 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)) }));
    I suggest to use UTF8 all the way as i did. And no problems.
     
  7. Please share compiled DLL.
    [DOUBLEPOST=1432291417][/DOUBLEPOST]
    Please share compiled DLL file.
     
  8. I have fixed that, dudes :)
     
  9. 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))
    back to

    Code:
    Data = File.ReadAllBytes(plugin.ScriptPath)
    in 263 line of PluginCompiler.cs. Its just temporary "fix", and there is needed correct one. So i don't need downgrade to old oxide.
     
    Last edited by a moderator: May 22, 2015
  10. Oh, god. Why.. :)

    Just replace
    Code:
    Encoding.Default.GetBytes
    to
    Code:
    Encoding.UTF8.GetBytes
    ...and it's done. Clean and nice. I mentioned this above.

    p.s Who can't do this - just wait for an update. This should be fixed very soon.
     
  11. Wulf

    Wulf Community Admin

    The next snapshot will fix this, thanks. :)
     
  12. It seems like we was both far away from real fix what we can see here https://github.com/OxideMod/Oxide/commit/3a19c5c5a73d8958ea3f837ea795598557fffd68
    :D

    ps i just was too lazy to google what paramethers have "Encoding" library.