0

I've a little trouble with validation messages and accented Characters (like "è" , "à", "ò" and other). If the validation message in my model contains one of the accented characters, no message was displayed :-(

I tried to use "è" instead of "è" and the message was displayed BUT the "è" isn't converted in "è" , so the message looks like "Il nome &egrave obbligatiorio" (italian sentence that means "Name is required").

Have you idea of how I can solve this?

liyakat
  • 11,825
  • 2
  • 40
  • 46
NikoDev
  • 15
  • 1
  • 9
  • `è` Did you miss the semicolon at the end? – Nadh Jul 05 '13 at 16:04
  • I use semicolon at the end. It was a typo in the question only. – NikoDev Jul 05 '13 at 16:06
  • Duplicate of thousand others like http://stackoverflow.com/questions/5948121/non-latin-characters-ouch/5948166#5948166 In Short: save your file properly (utf8) if you use utf8 characters in them. – mark Jul 05 '13 at 16:08
  • 1
    @mark : In all my files (Controllers , Views and others) I use `è` and it works ! Only in models files i've the error.. However I'll check the save format of my models. – NikoDev Jul 05 '13 at 16:11
  • there is no need to use `è` if you save them as utf8. however, it is usually better to use i18n, english base strings and PO files here. – mark Jul 05 '13 at 16:24
  • @mark po files are only relevant for multilingual sites, for one language (irrespective of the language) it's not usual (or I would say recommended) to use po files. – AD7six Jul 06 '13 at 08:26
  • @NikoDev It's not really relevant that using html entities "works", if using utf-8 characters does not work it simply means a charset mismatch (which typically is caused by saving files as not-utf8 and serving html pages as utf8). Controllers and especially models shouldn't be using html entities at all. – AD7six Jul 06 '13 at 08:28
  • @AD7six I disagree. Using and working with "different languages" all the time I highly recommend to do so even for a single language (in a non-english one, of course). It keeps those language specific utf8 chars out of the files and the code is cleaner if it is in english with a single source to translate. especially in controllers/models etc. it is also easier to work with in a team where one is not a native speaking person - or code reviewers. I am not saying that it is no overhead. But the overhead can be disregarded in favor of the obvious advantages IMO. Well, matter of preference. – mark Jul 06 '13 at 09:06
  • @mark you are assuming/implying the op does too; it's quite common to work exclusively in one language, and using po files _adds work_ in that circumstance. `It keeps those non utf8 chars out of the files ` - you say that like it's part of the problem. – AD7six Jul 06 '13 at 09:09

0 Answers0