Home Download Buy Blog Forum Support

Way to stop file converting to UTF8?

Way to stop file converting to UTF8?

Postby youradds on Tue Sep 03, 2013 8:18 am

Hi,

I've got a bit of an annoying issue, where sublime decides that because my file looks a bit like this:

Code: Select all
  'PROFILE_EMAIL_CHANGE_NOTE' => 'un email de vérification va être envoyé',
  'BUYER_COMPLAIN_TEXT' => 'Si vous avez un besoin de vous plaindre au sujet de votre commande, s\'il vous plaît utiliser le formulaire ci-dessous. Nous allons tenter de vous répondre dès que possible. S\'il vous plaît soyez aussi descriptif que possible pour nous aider à agir le plus rapidement possible.',
  'WANT_SHOW_INCH' => 'INCH',
  'EMAIL_BUYER_NOTIFICATION_TEXT1' => 'Cet email pour vous confirmer que votre dépôt à bien été reçu pour l\'oeuvre "<b>%s</b>". L\'artiste va prendre contact dans les prochains jours avec vous pour organiser l\'envoi et finaliser la vente (y.c. les frais d\'envoi. Attention, si vous ne vivez pas dans le même pays que l\'oeuvre, le prix d\'envoi sera calculé en conséquence',
  'ORDER_PANEL_NO_ORDERS_FOUND' => 'Pas de commande trouvés!',
  'RELATED_TAGS' => 'Mots clés',
  'SIGNUP_AGREE_TOS' => 'J\'accepte les  <a href="/tos">conditions</a>',
  'ERROR_TITLE' => 'Mince, une erreur!',
  'EMAIL_ORDER_DISPATCHED_SUBJECT' => 'Votre commande à été envoyée',
  'HEADER_LANG_FR' => 'Français',


...it wants to convert it into UTF8. Normally, that wouldn't be a problem. However, on this site I am using ISO-8859-1 for it all, so it *needs* to be in iso-8859-1. If I try and force it to save with a different encoding, it comes up with an alert telling me that its falling back to utf8. Is there anything I can do to stop this?

I'm currently having to change my editor just for that file to use NotePad++, as that lets me keep it as iso-8859-1 (and convert the broken utf8 file into iso-8859-1)

BTW - why can't we set email notifications to threads on here?

TIA

Andy
youradds
 
Posts: 8
Joined: Fri Dec 07, 2012 4:24 pm

Re: Way to stop file converting to UTF8?

Postby adzenith on Tue Sep 03, 2013 5:32 pm

youradds wrote:BTW - why can't we set email notifications to threads on here?

There are whole unanswered threads of people asking this same question.

Unfortunately I don't know anything about the encoding problem though :\
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Way to stop file converting to UTF8?

Postby bizoo on Wed Sep 04, 2013 7:54 pm

Not sure I understand your problem.

There are 2 settings for opening/saving files:
Code: Select all
    // The encoding to use when the encoding can't be determined automatically.
    // ASCII, UTF-8 and UTF-16 encodings will be automatically detected.
    "fallback_encoding": "Western (Windows 1252)",

    // Encoding used when saving new files, and files opened with an undefined
    // encoding (e.g., plain ascii files). If a file is opened with a specific
    // encoding (either detected or given explicitly), this setting will be
    // ignored, and the file will be saved with the encoding it was opened
    // with.
    "default_encoding": "UTF-8",

If you try to open a file with a encoding different of ASCII, UTF-8 and UTF-16, ST will use the fallback_encoding.
If your fallback_encoding is ISO-8859-1, everything must works flawlessly.
If your fallback_encoding is different, you must use the 'Reopen with Encoding' menu to open the file with the correct encoding.

You can check which encoding is used in the console when you open the file, eg:
Code: Select all
Unable to auto detect encoding, using fallback encoding Western (Windows 1252)

If you want to check the current encoding of a file (view), type in the console:
Code: Select all
view.encoding()

For new file, the default_encoding is used.
If you want another encoding, you must use the 'Save with Encoding' menu.
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Way to stop file converting to UTF8?

Postby youradds on Mon Oct 21, 2013 8:37 am

Hi,

Sorry for the late reply - totally forgot to check for replies (another reason we need notifications on this forum :( )

I'm not really 100% sure what the problem is myself, although I just had the same issue again. A new file I made was in UTF8, but I wanted it in ANSI. It was screwing up all the accents when copying the contents of that file into a proper ANSI file. I've tweaked the config like so:

Code: Select all
"default_encoding": "Western (Windows 1252)",


Hopefully that fixes it now :) Thanks for the reply!

Andy
youradds
 
Posts: 8
Joined: Fri Dec 07, 2012 4:24 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 20 guests