Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6553741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:37:05+00:00 2026-05-25T12:37:05+00:00

Recently was advised to used the following code in order to avoid UTF-8 problems

  • 0

Recently was advised to used the following code in order to avoid UTF-8 problems with input text into a database.

ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
#valid_string = ic.iconv(untrusted_string + ' ')[0..-2]
row[4] = ic.iconv(row[4] + ' ')[0..-2]
row[5] = ic.iconv(row[5] + ' ')[0..-2]

In development this works perfectly, however, once pushed onto our server we get the problem “uninitialised constant iconv” when we try to run the rake file containing the above code.

Is there an easy way to fix this issue? Tried adding gem 'iconv' to the gem file and running bundle install but this produced loads of errors, so assuming this is not the correct way to fix it…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:37:05+00:00Added an answer on May 25, 2026 at 12:37 pm

    Fixed it by adding require ‘iconv’ at the top of the rake file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I ran the following code on ideone.com (gcc-4.3.4) #include <stddef.h> #include <stdio.h> #include
Recently I found some simple source code of a bootloader.The following is the simple
Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion
Recently we got a new server at the office purely for testing purposes. It
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's
Recently a friend and I were talking about securing stored procedure code in a
I recently inherited a poorly maintained production database with heavily fragmented indexes (most of
I have recently switched from python 2.7 to python 3.2 considering following folder structure:
Recently I met the following exception at C# solution: Error 2 Could not load
Recently i saw this piece of code. Shouldnt this line be a compile error?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.