Лечим кодировку при экспорте CSV в Redmine

redmineПоставил недавно последний Redmine 2.x. Обнаружилось что при экспорте в формат CSV неверно отображаются русские символы. Поэтому в нем хочу добавить простенькое решение. Итак, открываем файл ru.yml. У меня он находится по пути:

/usr/local/share/redmine/config/locales/ru.yml

Ищем строку с параметром general_csv_encoding и меняем значение с UTF-8 на WINDOWS-1251:

# Было
general_csv_encoding: UTF-8

# Стало
general_csv_encoding: WINDOWS-1251

Перезапускаем Redmine.

UPD От пользователя Bozo: “Экспорт в csv происходит нормально, но в utf без bom. А глупые мс-продукты при виде utf без bom сходят с ума. Так что нужно всего лишь добавлять bom к созданному csv-файлу. Это можно реализовать микро-плагином за 10 минут.”

Плагин от Bozo:

require_dependency ‘queries_helper’

module BOMFixQueriesHelperPatch
def self.included(base)
base.send(:include, InstanceMethods)

base.class_eval do
alias_method_chain :query_to_csv, :fixed_bom
end
end

module InstanceMethods

# adds bom symbols to utf-encoded csv file
def query_to_csv_with_fixed_bom *args
ret = query_to_csv_without_fixed_bom *args
if l(:general_csv_encoding) == ‘UTF-8′
ret = “\xef\xbb\xbf”+ret
end
ret
end

end
end
Рекомендуем почитать
Expected kind of OpenSSL::SSL::SSLContext в Redmine

При установке нового redmine 2.3.0 и дальнейшей его конфигурации возникает ошибка при отправке почты: (Expected kind of OpenSSL::SSL::SSLContext)) Лечится эта Читать дальше...

Получение почты и создание тикетов в Redmine

Появилась недавно небольшая задачка, которая позволяет создавать / отвечать на тикеты в Redmine через email. Получение почты можно организовать как Читать дальше...

Знаки вопроса в redmine

После установки свеженького redmine обнаружилась проблема с отображением русских символов. Вместо них были только знаки вопроса. Для решения данной проблемы Читать дальше...

Интеграция redmine с LDAP (Active Directory)

Процесс интеграции redmine с LDAP довольно прост. Состоит он из 2 этапов. Для начала создайте пользователя в своем домене, например Читать дальше...

Поделиться

106 комментариев к “Лечим кодировку при экспорте CSV в Redmine

  1. I just want to say I’m very new to blogging and honestly loved you’re web-site. Almost certainly I’m want to bookmark your blog . You actually come with fantastic articles. Thanks a lot for revealing your website page.

  2. There are absolutely a lot of information like that to take into consideration. That is an excellent indicate raise. I use the thoughts above as basic inspiration yet clearly there are inquiries like the one you bring up where the most important point will certainly be working in truthful good faith. I don?t recognize if finest methods have actually emerged around points like that, but I make sure that your task is clearly identified as a fair game. Both children and ladies feel the impact of just a moment?s pleasure, for the rest of their lives.

  3. I simply must tell you that you have written an excellent and unique article that I really enjoyed reading. I’m fascinated by how well you laid out your material and presented your views. Thank you.

  4. I don’t know if it’s just me or if perhaps everybody else encountering issues with your website. It appears like some of the text in your content are running off the screen. Can somebody else please comment and let me know if this is happening to them as well? This could be a issue with my web browser because I’ve had this happen before. Appreciate it

  5. The next time I read a blog site, I wish that it doesn’t disappoint me as high as this. I mean, I know it was my choice to read, but I in fact assumed youd have something intriguing to state. All I hear is a lot of yawping concerning something that you can deal with if you werent as well busy searching for interest.

  6. Hi, Neat post. There is a problem along with your site in web explorer, would
    check this? IE nonetheless is the market leader and a huge portion of people
    will leave out your fantastic writing because
    of this problem.

  7. An excellent share, I simply provided this onto a coworker that was doing a little evaluation on this. And he as a matter of fact got me breakfast due to the fact that I located it for him. smile. So let me rephrase that: Thnx for the reward! Yet yeah Thnkx for spending the time to review this, I really feel highly about it and also enjoy learning more on this topic. If possible, as you become proficiency, would you mind upgrading your blog with even more details? It is extremely handy for me. Big thumb up for this article!

  8. I?m pleased, I should say. Really hardly ever do I run into a blog site that?s both educative as well as entertaining, and also let me tell you, you have actually hit the nail on the head. Your concept is exceptional; the issue is something that inadequate people are talking intelligently about. I am extremely satisfied that I stumbled across this in my search for something relating to this.

  9. Hmm it seems like your site ate my first comment
    (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your
    blog. I too am an aspiring blog writer but I’m
    still new to everything. Do you have any recommendations for inexperienced blog writers?
    I’d certainly appreciate it.

  10. An interesting conversation deserves comment. I think that you ought to write a lot more on this topic, it could not be a forbidden subject yet typically individuals are inadequate to talk on such subjects. To the next. Cheers

  11. After study a few of the blog posts on your website currently, and also I genuinely like your way of blogging. I bookmarked it to my book marking website listing and will certainly be checking back soon. Pls have a look at my internet site as well and also let me recognize what you believe.

  12. Hi there, just became aware of your blog through Google,
    and found that it’s really informative. I am gonna watch out for brussels.

    I’ll appreciate if you continue this in future. Numerous people
    will be benefited from your writing. Cheers!

  13. Oh my benefits! an incredible write-up dude. Thank you Nevertheless I am experiencing problem with ur rss. Don?t know why Not able to register for it. Exists any individual obtaining similar rss issue? Any person who understands kindly react. Thnkx

  14. An excellent share, I just offered this onto a colleague who was doing a little analysis on this. As well as he actually purchased me breakfast since I discovered it for him. smile. So let me reword that: Thnx for the reward! But yeah Thnkx for spending the time to review this, I really feel highly regarding it and also like finding out more on this topic. Preferably, as you come to be knowledge, would certainly you mind updating your blog site with even more information? It is very handy for me. Big thumb up for this blog post!

  15. I’m impressed, I must say. Seldom do I encounter a blog that’s equally educative and entertaining, and let me tell you, you’ve hit the nail on the head. The problem is something which not enough people are speaking intelligently about. Now i’m very happy that I came across this during my search for something concerning this.

  16. I was extremely pleased to find this web-site. I wished to thanks for your time for this terrific read!! I definitely taking pleasure in every little of it and I have you bookmarked to take a look at new things you blog post.

  17. Having read this I thought it was rather enlightening. I appreciate you taking the time and energy to put this information together. I once again find myself spending way too much time both reading and posting comments. But so what, it was still worth it!

  18. Oh my goodness! Amazing article dude! Many thanks, However I am going through difficulties with your RSS. I don’t know why I can’t subscribe to it. Is there anybody getting similar RSS problems? Anyone that knows the solution will you kindly respond? Thanx!!

  19. You are so awesome! I don’t think I’ve read something like that before. So good to find someone with some genuine thoughts on this subject. Really.. many thanks for starting this up. This web site is something that is needed on the web, someone with a bit of originality!

  20. Very great post. I just stumbled upon your blog and wished to mention that I have really enjoyed surfing around your blog posts. After all I will be subscribing in your feed and I hope you write again very soon!

  21. I was very delighted to find this web-site. I wanted to thanks for your time for this fantastic read!! I most definitely taking pleasure in every little bit of it as well as I have you bookmarked to take a look at new stuff you blog post.

  22. Hello there! I could have sworn I’ve been to this web site before but after going through a few of the articles I realized it’s new to me. Anyhow, I’m definitely happy I found it and I’ll be book-marking it and checking back often!

  23. Good post. I learn something totally new and challenging on sites I stumbleupon on a daily basis. It’s always interesting to read through content from other authors and use a little something from other websites.

  24. Hi, I do think this is a great web site. I stumbledupon it 😉 I’m going to return once again since I book marked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

  25. An excellent share, I simply provided this onto an associate who was doing a little analysis on this. And also he actually bought me breakfast due to the fact that I found it for him. smile. So let me rephrase that: Thnx for the treat! Yet yeah Thnkx for investing the moment to discuss this, I really feel highly regarding it and also like reading more on this topic. If possible, as you come to be knowledge, would certainly you mind upgrading your blog with more information? It is highly practical for me. Huge thumb up for this post!

  26. Hi, I do believe this is a great web site. I stumbledupon it 😉 I may revisit yet again since i have saved as a favorite it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

  27. I have to thank you for the efforts you have put in writing this website. I really hope to view the same high-grade content by you in the future as well. In fact, your creative writing abilities has motivated me to get my own site now 😉

  28. I was more than happy to discover this great site. I need to to thank you for ones time just for this wonderful read!! I definitely appreciated every bit of it and i also have you saved as a favorite to see new information in your website.

  29. I blog often and I seriously thank you for your content. This great article has really peaked my interest. I will bookmark your site and keep checking for new details about once a week. I opted in for your RSS feed as well.

  30. When I originally commented I clicked the -Alert me when new remarks are added- checkbox as well as now each time a comment is included I obtain 4 emails with the same comment. Is there any way you can remove me from that service? Many thanks!

  31. Hello! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up
    losing months of hard work due to no backup. Do
    you have any methods to protect against hackers?

  32. I’m excited to discover this page. I wanted to thank you for your time for this fantastic read!! I definitely appreciated every bit of it and i also have you saved to fav to check out new stuff on your website.

  33. Having read this I believed it was very enlightening. I appreciate you taking the time and effort to put this informative article together. I once again find myself spending a significant amount of time both reading and posting comments. But so what, it was still worth it!

  34. This is the perfect webpage for everyone who wants to find out about this topic. You know a whole lot its almost tough to argue with you (not that I personally will need to…HaHa). You certainly put a brand new spin on a topic which has been written about for ages. Excellent stuff, just great!

  35. Good post. I learn something totally new and challenging on websites I stumbleupon everyday. It will always be interesting to read through articles from other authors and use a little something from other websites.

  36. After I initially commented I appear to have clicked the -Notify me when new comments are added- checkbox and from now on each time a comment is added I recieve 4 emails with the same comment. Is there a means you are able to remove me from that service? Many thanks!

  37. When I initially commented I appear to have clicked the -Notify me when new comments are added- checkbox and from now on every time a comment is added I get four emails with the same comment. Is there a way you are able to remove me from that service? Thanks a lot!

  38. It’s the best time to make a few plans for the long run and it’s
    time to be happy. I have read this submit and if I
    could I wish to recommend you some interesting things or advice.
    Maybe you can write next articles relating to this article.
    I want to learn even more things about it!

  39. The next time I read a blog, Hopefully it won’t fail me just as much as this particular one. After all, Yes, it was my choice to read through, however I truly thought you’d have something helpful to talk about. All I hear is a bunch of moaning about something that you could possibly fix if you weren’t too busy seeking attention.

  40. When I initially left a comment I seem to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I get four emails with the same comment. Perhaps there is a means you can remove me from that service? Thanks!

  41. Howdy! This article could not be written much better! Going through this post reminds me of my previous roommate! He always kept preaching about this. I most certainly will forward this information to him. Pretty sure he’s going to have a good read. Thank you for sharing!

Оставить ответ к g than Отменить ответ

Ваш адрес email не будет опубликован. Обязательные поля помечены *