search for: kcode

Displaying 20 results from an estimated 64 matches for "kcode".

Did you mean: code
2010 Sep 23
2
rspec runner setting $KCODE considered harmful?
...ed in a test case. I scratched my head and thought "why would running from within the test harness change the behavior of my code?" Clearly it was the Heisenberg uncertainty principle in action! :) I discovered the root cause was that the rspec runner is setting the magical ruby global, $KCODE, to ''u''. However, my application (which is not a rails app) had never specified $KCODE. I was relying on some default behavior of regular expressions under ruby 1.8 (byte-wise character matching semantics) that *change* when $KCODE is set to "u". Specifically, all regula...
2005 Mar 16
1
Re: Unicode support
...(even a pure-ruby one) that changes the behavior. Nick > (replying to myself...see below) > > Kevin Smith wrote: > > Nick wrote: > > > >> > >> I''ll be the first to admit I''m out of my league in this area. It looks > >> like the KCODE built in variable is the string encoding. To get > >> started, we may need to start with ANSI to Unicode conversion, and go > >> from there. > > > > > > You''re probably right. I am still curious how the other ruby libraries > > have handled th...
2006 Jan 05
1
unicode hacks - fixes for webrick and Safari
...ode_hacks/>. I have found some problems running my app in development on Webrick and looking at it with Safari (MacOS X 10.4.3, Safari 2.0.2). Some files are sent with different sizes (e.g. default css example, or controls.js ), and it causes long delays for each request. When I changed KCODE to ''none'', everything worked OK. It seems that string overloading borks something in Webrick internally. My solution is to set KCODE in before/after filters, so that webrick code is not affected. There is some Rails code run before/after the filters, so it is not completely...
2006 Feb 15
1
where to set $KCODE
My application uses only UTF-8. Which is the canonical place to do something global like setting $KCODE? -- fxn
2005 Aug 28
7
Unicode support in FXRuby 1.6
All, As some of you know, Jeroen has added support for Unicode strings in the unstable development version of FOX (version 1.5). I''m trying to plan ahead to decide how best to support this for FXRuby 1.6, but I don''t really know anything about Ruby''s support for Unicode or i18n in general. If you''re familiar with this topic (how/if Ruby deals with Unicode
2007 Nov 13
1
win32-api idea - wide method first based on $KCODE
.....) It looks for SomeFunc. If that fails it looks for SomeFuncA (which is what most of the functions actually default to). If that fails it looks for SomeFuncW. If that fails, then an error is raised. What about switching the order so that it looks for SomeFuncW -first- and SomeFuncA -second- if $KCODE = u? Does that seem reasonable? Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immedi...
2009 May 03
13
Ruby or Rails bug?
In irb all works fine: # irb irb(main):001:0> require ''rubygems'' => true irb(main):002:0> require ''raspell'' => true irb(main):003:0> speller = Aspell.new("ru_RU") => #<Aspell:0x7f8692c9d158> irb(main):004:0> speller.suggestion_mode = Aspell::NORMAL => "normal" irb(main):005:0>
2008 Jun 18
2
[ win32utils-Bugs-20722 ] Windows::Error.get_last_error only returns the first character (PATCH)
...----------------------------------------- >Comment By: John Whitley (whitley) Date: 2008-06-18 16:22 Message: Actually, I rescind my patch above. The deeper problem seems to lie in win32-api, api.c, this code: // The order of ''A'' and ''W'' is reversed if $KCODE is set to ''UTF8''. if(!strcmp(rb_get_kcode(), "UTF8")){ first = "W"; second = "A"; } W functions accept/return UTF16 not UTF8, which breaks the rest of the win32-* modules hard, as the bug above exhibits. For example, Win32::Events...
2006 May 26
13
win32-dir, unicode
Hi, I''ve got a preliminary version of the pure Ruby version of win32-dir in CVS. However, I was hoping to work out the Unicode issue. Run this: from = "C:\\test" to = "?????" Dir.mkdir(from) unless File.exists?(from) Dir.create_junction(to, from) It works, but my explorer (and dos) window shows the name garbled. I don''t think it''s a font
2007 Jul 20
8
Wx::StaticText
Salut alex. J''ai une question a propos de wx::statictext(wxruby2) est-il possible de mettre les accents pour la langue française?, car pour l''instant je ne peut pas mettre l''accentuation alors que ça marche bien avec "wxruby". merci Sebastien _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org
2006 Nov 08
14
Increased memory requirements on 1.2
I just recently upgraded a rails app of mine to run on edge (and the 1-2-pre-release branch) and I noticed my fcgis required roughly 6-8MBs more memory after just a couple requests. For example, each fcgi on edge would start around 40MB and rise to ~46MBs after a couple requests. I downgraded my app back to 1.1.6 and each fcgi would start at around 33MBs and rise to ~38MB. As a result of the
2006 Nov 14
2
umlauts problem...
Hi, I have a MSSQL db server which I am accessing from RoR. But the database has a table T with a field name ("Hölle") consisting of umlauts :( how to access this field?? Thanks, Ram -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on
2008 May 06
1
Problem with ActionWebService and UTF-8 encoding
...ers that must contain xml. The data sent are in UTF-8, but the non-ascii char (é, à ...) in the message are crippled at the end. I tested the app, database, html, ... all accept utf-8, a direct http post works well, but going through the web service broke the content. I tried to manually set the $KCODE en require de iconv in environment.rb : $KCODE = ''UTF8'' require ''iconv'' It''s with rails 1.2.6 Any idea ? Thanks, David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups &q...
2005 Mar 14
11
[Fwd: Re: Help a newbie pick a gui tool kit]
Hey Guys, This just came over the rubytalk list. Does anybody have any Debian experience? BTW, one thing this project *really* could use is people to package wxruby for <your distro here>. You don''t need SWIG/C++ experience for it, and a little work could help a lot of people. Nick -------- Original Message -------- Subject: Re: Help a newbie pick a gui tool kit Date: Sun, 13
2009 Jun 17
12
FasterCVS and Rails
...do |row| data << row.to_s + "<br>" end And the first two lines in the file: "20.1","Maria José",,"9" "10.2","José Maria",,"10" I''m using fastercsv 1.2.3 and rails 2.1.2 Note: I''ve tried adding $KCODE = "utf8" but it still does not work. Thanks. Best regards, Migrate -- Posted via http://www.ruby-forum.com/.
2011 Sep 14
1
Hitting 500 status code on invalid UTF-8 byte sequence in params
...# should really prevent that from happening def encode_params(params) That''s exactly what happens to us, and since the data isn''t coming from a webform we don''t enjoy the mentioned form handling. I''d vote for a fix along the lines of Iconv.conv("#{$KCODE}//IGNORE", $KCODE, ...), but I''m not sure what would be a good place to apply that, more so that 2.3 and 3.x differ greatly in this regard, AFAICT. -- Regards, Alex -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. T...
2006 Mar 21
2
How do I get substring of utf-8 string?
I''m trying to get substring from a utf-8 encoded string. (say, first 50 characters of the string) String#[0..49] would give me the first 50 bytes not 50 characters.. I know there is jcode library, but it only let you count number of characters in utf-8 string. unicode gem doesn''t seem to help much. unicode_hacks gem seem to solve the problem, but it also seems to
2012 Feb 28
4
JIRA anyone?
...m won''t load. literally: ''irb -r soap4r'' returns :cannot load such file... I also set this up in a Gemfile and tried to run this from the rails console: /Users/TAllison/projects/cs_jira/vendor/cache/ruby/1.9.1/gems/soap4r-1.5.8/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective /Users/TAllison/projects/cs_jira/vendor/cache/ruby/1.9.1/gems/soap4r-1.5.8/lib/xsd/iconvcharset.rb:9:in `<top (required)>'': iconv will be deprecated in the future, use String#encode instead. /Users/TAllison/projects/cs_jira/vendor/cache/ruby/1.9.1/gems/soap4r-1...
2006 Jan 30
15
i18n when?
Hi all, Just wondering... Are there any plans to include i18n support in Rails anytime soon? I guess this is about the only feature I''m realy missing in Rails. Any thoughts? Regards, Harm de Laat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/63681052/attachment.html
2006 Jul 18
10
searching with chinese chars
...seems to be OK. As David mentioned in a question I made a little while ago, Ferret''s index is agnostic, in the sense that you can store anything in it. I then wrote another one to search the index created. This is what it looks like: #################################### #!/usr/bin/ruby $KCODE = ''u'' require ''cgi'' require ''ferret'' include Ferret index = Index::Index.new(:path => ''/var/index'', :default_field => "*") cgi = CGI.new("html4") result = "" if cgi[''query'...