TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
ORM charset for Spanish accents
  • Hi. I don't know if I'm posting this in the correct category.

    I'm trying to use ORM combine with Model to manipulate my data with my Data Base. All of that works perfect, but, when I try to insert / update a value from a Form to my database with special chars, in this case, Spanish language, the data is save it with "?" (question marks) instead the character, for example: Mamá (mother) => Mam??.

    But, when I insert the same information using the DB class, the data is saved it perfectly: Mamá => Mamá.

    I checked the charset on my application, the charset of my DB, Tables and fields and they all are OK (UTF-8). Like I said: Using ORM is not working properly, but, using DB class works perfect.

    What is the difference?

    Check this post with the model and functions to see with more details what I'm trying to do/fix.

    http://stackoverflow.com/questions/12222419/kohana-orm-charset-for-spanish-accents

    Hope you can help me to fix this.

    Thank you.

  • if the encoding of the page is other than UTF-8, like ISO 8859-1, the data that will go inside the model is going to be corrupted. If the database is UTF-8, its merely a problem of encoding on the client side. The browser will respect the encoding you set on your page and send the content using the charset specified. Also, make sure you are not DOUBLE encoding UTF-8 (in that case, it would look like MamÁ£) or converting the UTF-8 using callbacks, back to ASCII or latin-1

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion