search for: jcode

Displaying 20 results from an estimated 29 matches for "jcode".

Did you mean: code
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
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 change the methods of String class directly so that it may confuse rails which expects String#[] to gi...
2006 Jan 10
1
Validating Umlauts
...me problems validating German-specific characters (????). I have a tag-model which validates format of :name, :with => /^\w+$/. This throws an exception if german characters are used. My tables are all utf-8 and my environment.rb has the lines $KCODE = ''u'' require ''jcode'' to set the character set to utf-8. Funnily enough, if I comment out the tag validation and add a new tag, an new row is created but the field tags.name is blank if the name includes ? ? ? or ?. I''d be grateful if anyone could offer me some advice. -- Posted via http://www.r...
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
2007 Apr 19
5
Chinese full text searching by acts_as_ferret?
How to add Chinese language full text searching function by using acts_as_ferret? RegExpAnalyzer.new(/./,false) this analyzer, i don''t know how to use it! does it works like this: user searching---->acts_as_ferret---->ferret ???? -- Posted via http://www.ruby-forum.com/.
2006 Jan 17
4
textarea problem with accentued chars
Hello, I have a problem with accentued characters return from a textarea I have 3 simple files to show example ( below ). index.rhml : If I put "?nial" inside the textarea, then submit to :action => post post.rhml : wrote ?nial 195 "\303\251nial" // params[:comment][:message] return => ?nial params[:comment][:message][1] return => 195 ! ( 195 is not
2007 Apr 29
1
Chinese full-text support! Still fail-_-
...but i can not search chinese words! > > I don''t know how to deal with this! Jens Kraemer wrote: > On Thu, Apr 19, 2007 at 03:49:48PM +0200, Chengcai He wrote: >> in environment.rb, i add the following code >> $KCODE = ''u'' >> require ''jcode'' >> ENV[''LANG''] = ''en_US.utf8'' >> require ''acts_as_ferret'' >> >> in my model, topic.rb >> acts_as_ferret :fields => [:subject, :body], :analyzer => >> Ferret::Analysis::RegExpAnalyzer.new(/./,f...
2006 Jul 11
0
malformed utf-8 character error
.../gems/1.8/gems/activesupport-1.3.1/lib/active_support/json/encoders/core.rb:31:in `unpack'' D:/EErisken/Downloads/ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/json/encoders/core.rb:31 D:/EErisken/Downloads/ruby/InstantRails/ruby/lib/ruby/1.8/jcode.rb:212:in `each_char'' D:/EErisken/Downloads/ruby/InstantRails/ruby/lib/ruby/1.8/jcode.rb:211:in `each_char'' D:/EErisken/Downloads/ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/json/encoders/core.rb:22 D:/EErisken/Downloads/ruby...
2005 Mar 04
3
Missing rpms for samba-ldap script
...g for perl-Unicode-String-2.07-0.1.fc2.dag.i386.rpm...not found. Checking for perl-Unicode-Map8-0.12-0.1.fc2.dag.i386.rpm...not found. Checking for perl-Unicode-MapUTF8-1.09-0.1.fc2.dag.i386.rpm...not found. Checking for perl-Convert-BER-1.31.01-1.1.fc2.dag.noarch.rpm...not found. Checking for perl-Jcode-0.83-0.1.fc2.dag.i386.rpm...not found. Checking for perl-Net_SSLeay-1.23-8.k12ltsp.0.3.1.i386.rpm...not found. Checking for perl-Convert-ASN1-0.18-3.noarch.rpm...not found. Checking for smbldap-tools-0.8.6-1.noarch.rpm...not found. Checking for perl-Unicode-Map-0.112-0.1.fc2.dag.i386.rpm...not foun...
2006 Jul 12
7
Does anyone work with iso-8859-1 database ?
hello, Our database is in is-8859-1, and I want to update some text fields without success due to some accentuate characters ?? ect ... In my html page (where the charset is iso-8859-19) my textarea display the accentuate characters well and when the user post the form ... I thought that I just need to save it .... without success since ruby map one byte for one character ... So I
2007 Jan 19
1
Trouble with Rails/Ri18n
...ment.rb states: # Include your application configuration below # Require Rails libraries (Ri18n) require ''rubygems'' require ''gettext'' require ''i18nservice'' $KCODE = ''u'' # unicode require ''jcode'' # correct string methods for utf8 I18nService.instance.po_dir = "locale" # original: "#{RAILS_ROOT}/locale" I18nService.instance.lang = ''de'' ADDITIONAL_LOAD_PATHS.concat %w( # ... other entries vendor vendo...
2006 Aug 14
1
UK Pound Signs being handled as \243?
Hello, It seems like something has recently caused ? symbols to be displayed as \243 on our FreeBSD 6 server. We think this is causing our rails-based payment system to fail to process transactions which is obviously very bad for us! Why / How would this start happening? The server is configured to use UK ISO keyboard map and it was working fine until recently. I''m at a loss to
2006 May 19
1
database.yml and encoding: utf8 -> mysql error
...the db. I have changed the character set and collation in the db to utf8 and utf8_danish_ci - also checked the mysql to if its ok: show collations like "%danish%"; utf8_danish_ci utf8 203 Yes 8 I then add the following environment.rb: $KCODE = ''u'' require ''jcode'' och database.yml encoding: utf8 If I then restart the webserver I get: Character set ''utf8'' is not a compiled character set and is not specified in the ''/usr/local/mysql/share/mysql/charsets/Index'' file rake aborted! Can''t initialize charact...
2007 May 16
0
How we got rid of a bus error when using acts_as_ferret
...was gone. We started to suspect the analyzer that we were using: :analyzer => Ferret::Analysis::RegExpAnalyzer.new(FerretHelper::GENERIC_ANALYSIS_REGEX, true) Where GENERIC_ANALYSIS_REGEX is /([a-zA-Z]|[\xc0-\xdf][\x80-\xbf])+|[0-9]+|[\xe0-\xef][\x80-\xbf][\x80-\xbf]/ This is used, a la Jcode, to tokenize both European-language words, numbers, and CJV chars. Interestingly, we started to suspect if Mongrel''s development mode is the culprit. But anyway, we just created the Analyzer beforehand, and put it somewhere (say in some lib/helpers/), and now we have something like: ac...
2007 May 23
1
Memory Leak When Searching For Multilingual Keyword(s)
...nch (utf-8) German (utf-8) Spanish (utf-8) Chinese (utf-8) Japanese (utf-8) Seems no existing online article / trick would solve the issue. I had already tried all the tricks: 1. MultiLingualFerretTools plugin 2. set in environment.rb: $KCODE = ''u'' require ''jcode'' ENV[''LANG''] = ''de_DE.UTF-8 at euro'' ENV[''LC_TIME''] = ''C'' -- Posted via http://www.ruby-forum.com/.
2006 Oct 19
2
How to deal with accentuated chars in 0.10.8?
I''m startin to use Ferret and acts_as_ferret. I need to use something like EuropeanAnalyzer (http://olivier.liquid-concept.com/fr/pages/2006_acts_as_ferret_accentuated_chars). By example, if the user search by "gonzalez" you can find documents taht contents the term "gonz?lez" (gonzález) The EuropeanAnalyzer is based on Ferret::Analysis::TokenFilter,
2005 Dec 30
0
L18n help
...need some help writing some code in rails about cookies. what i want to do is depending on the cookie value sent i want to set the language for the page . the code is something like in applicationcontroller.rb $KCODE = 'u' # lets go unicode, you will have less trouble ... require 'jcode' # and use the right string methods for utf-8 # The directory where translation files (PO files) will go I18nService.instance.po_dir = "#{RAILS_ROOT}/locale" # let's use telugu everywhere @lan = lan ="te" I18nService.instance.lang = lan what i want to do i...
2005 Dec 09
1
utf-8 BIG problems
...e, i need this for exporting to pdf en excel. now i can also import from csv, characters like éàï.... But the display is then fucked up. i get wierd symbols ------------------- Another situation: I have seen a post here to add to environment.rb: $KCODE = ''UTF8'' require ''jcode'' and to application.rb: before_filter :configure_charsets after_filter :fix_unicode_for_safari def parse_errors(obj) return nil if obj.nil? str = "<ul>" obj.errors.each_full do |msg| str += "<li>" + msg +"</li>" end st...
2005 Dec 21
10
Investigating Unicode. Take 2, with nastities and allegations.
...ll exploit Rails with Unicode. Let''s say you are storing your data in Unicode (because if you don''t you must spend the rest of your days in Hell writing Sanskrit in octets on a concrete plate with a dinner fork). You think your bases are covered and you did require ''jcode''. Except that ''jcode'' won''t help. Let''s have a look at this nice little snippet. class User validates_presence_of :login end Looks buletproof, isn''t it? If a user enters spaces into the form they are going to get String#strip''p...
2006 Feb 05
2
working with rails and unicode
...sample application from the "Agile Web Development With Rails" book. Following the "HowToUseUnicodeStrings" wiki document, I have made the following changes: config/environment.rb: # Include your application configuration below $KCODE = ''u'' require ''jcode'' admin.rhtml: <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /> database.yml: development: adapter: mysql encoding: utf8 application.rb: class ApplicationController < ActionController::Base before_filter :set_charset...