Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

activerecord problem when create with characters with accents or special characters

#5370

Rails version: 2.3.5
Ruby version: 1.8.7

I use the activerecord in order to create a record with special characters contained in a string, then when I look in the database it shows the string broken, ej. before: "texto con carácteres especiales como ñ y otros" after insert or create: "texto con car", the rest of string is missed.

When I check the log I see:

INSERT INTO posts (created_at, title, excerpt, updated_at, blog_id, publish, content, classification_id, author_id, comments_count) VALUES('2010-08-12 22:20:28', 'titulo con caracteres especiales áéíóúÁÉÍÓÚÑñ más caracteres "-,'¿?!ª\|}´{¨¨&%$#@; final del titulo', 'intro de la publicación', '2010-08-12 22:20:28', 1, 0, 'prueba [#5](/projects/8994/tickets/5 "Ticket #5"): contenido de la publicación', NULL, 1, 0)

Apparently all is fine, but in the database appears this:

title excerpt content


titulo con caracteres especiales intro de la publicaci prueba #5 Introduce ActiveResource::Base.timeout to allow Net::HTTP#read_timeout to be set: contenido de la publicaci

I using the following configuration:
Adapter: mysql
Connection Encoding: utf8
Table Character-set is: utf8
Table Collation is: utf8_general_ci

Reported by Alexander C · August 13th, 2010 @ 12:19 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Andrea Campi
    Andrea Campi
    • Tag changed from activerecord, create, insert, rails2.3, special-chars to 2-3-stable, activerecord, create, insert, special-chars

    October 16th, 2010 @ 11:53 PM

  2. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:29 PM

  3. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:29 PM