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 6386147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:59:15+00:00 2026-05-25T02:59:15+00:00

When I insert certain strings coming in from API calls into my db, they

  • 0

When I insert certain strings coming in from API calls into my db, they get cut off at certain characters. This is with ruby 1.8.7. I have everything set to utf8 app-wide and in MySQL. I typically don’t have any problem entering utf8 content into the DB in other parts of the app.

It’s supposed to be “El Soldado y La Muñeca”. If I insert it into the db, only this makes it in: “11 El Soldado y La Mu”.

>> name
=> "11 El Soldado y La Mu?eca(1).mp3"
>> name[20..20]
=> "u"
>> name[21..21]
=> "\361"
>> name[22..22]
=> "e"
  1. is that a utf8 character?
  2. i know that ruby 1.8 isn’t encoding aware, but to be honest i always forget how this should affect me — i always just set everything at all the other layers to utf8 and everything is fine. WHY THIS NO WORK NOW?

update

CORRECTION– i was wrong, it’s not coming from the api, it’s coming from the file system.

the wrongly-encoded character is coming from inside the house!

new question: How can I get utf8 characters from File#path

  • 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-25T02:59:16+00:00Added an answer on May 25, 2026 at 2:59 am

    You are somehow getting a Latin-1 (AKA ISO-8859-1) ñ rather than a UTF-8 ñ. In Latin-1 the ñ is 361 in octal (hence your single byte "\361"). In UTF-8 that lower case tilde-n should be \303\261 (i.e. bytes 0303 and 0261 in octal or 0xc3 and 0xb1 in hex).

    You might have to start playing with Iconv in the Ruby side to make sure you get everything in UTF-8.

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

Sidebar

Related Questions

So this might be dumb, but I can't get anything to insert into a
I am trying to insert certain values into the table using SQL server 2005.
I have a huge file, where I have to insert certain characters at a
I can't figure out what's causing my INSERT INTO's to fail to certain table
INSERT INTO [Tasks] ([LoginName] ,[Type] ,[Filter] ,[Dictionary] ,[Description]) Select N'Anonymous',4,'SomeTable.targetcode in (select Code from
Like: insert into table (col) values (N'multilingual unicode strings') I'm using SQL Server 2008
I've a long template from which I need to extract certain strings based on
I have to insert a string after a certain character using Ruby. For example,
i need to insert a string into another string at a certain range. I
I want to insert a few certain values from a php file, to my

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.