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

  • Home
  • SEARCH
  • 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 3332972
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:44:43+00:00 2026-05-17T23:44:43+00:00

Does anyone have a working setup for hunspell and Emacs ? Simply setting ispell-program-name

  • 0

Does anyone have a working setup for hunspell and Emacs? Simply setting ispell-program-name to hunspell doesn’t work, the output (when using flyspell, for example) looks like below:

-> UTF-8 encoding error. Missing continuation byte in 0. character position: - 9631: word not found

(my files are usually encoded in UTF-8)

I’ve seen a few different setups, but they’ve all failed in one way or another. If the encoding works like it should it usually has problems finding the right dictionary.

Anyone with a working solution? It would be nice to be able to switch between two dictionaries (the default should be the swedish dictionary, and the secondary english), but having anything running would be even better.

  • 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-17T23:44:43+00:00Added an answer on May 17, 2026 at 11:44 pm

    If you are getting that UTF-8 encoding error, then it means that the hunspell process is getting run with an argument specifying some other encoding. When I check my process list, for example, I see this child process to Emacs once it has started up:

    /usr/bin/hunspell -a  -B -i iso-8859-1
    

    The ispell-get-coding-system function is what decides which encoding to use, which it does by examining the big ispell-dictionary-alist variable that seems to list every language known to Emacs. The function normally grabs the last symbol off of the entry that matches the language you want to check. For some reason that I did not bother to figure out, this list has iso-8859-1 for English — instead of, you know, paying attention to the encoding in your actual buffer. I know, it seems to make no sense. But we carry on.

    You would think that you could override this by setting your own value for the variable ispell-dictionary-alist and use utf-8 as the last of the eight parameters:

    ;; I could never get Emacs to pay attention to this
    (setq ispell-dictionary-alist
      '((nil "[A-Za-z]" "[^A-Za-z]" "[']" t ("-d" "en_US") nil utf-8)))
    

    But I could never get this setting to actually work, whether or not I did a (load-library "ispell") first in my .emacs, or whether I did it inside of one of those:

    ;; Did not work for me either.
    (eval-after-load "ispell" '(progn ...))
    

    Either way, if I started up a fresh Emacs and entered *scratch* and typed ispell-dictionary-alist and pressed Control-J, then the huge original list that ispell creates would come up. Every time.

    So I decided to do an end-run around the entire problem of this huge list and simply rewrite the ispell-get-coding-system function to always return utf-8. Sure, this will bite me the next time that I open a file that is really in iso-8859-1, but I never do that anyway, right?

    To implement this successfully in my .emacs file (well, ~/.emacs.d/init.el but that takes so much typing for a Stack Overflow answer) required this code:

    ;; It works!  It works!  After two hours of slogging, it works!
    (if (file-exists-p "/usr/bin/hunspell")
        (progn
          (setq ispell-program-name "hunspell")
          (eval-after-load "ispell"
            '(progn (defun ispell-get-coding-system () 'utf-8)))))
    

    I now have hunspell up and working like a champ! Unfortunately the whole reason I went through getting it working was in the hopes that its dictionary was vastly larger than aspell’s but I see that it’s highlighting some of the same words. Oh well, I’ll try another approach. I basically want a spell checker that can be loaded up with the /usr/share/dict/american-english-huge dictionary that is available on Ubuntu, but aspell died in many ways when I tried to expand its horizons. Maybe I will be luckier with hunspell — we will see.

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

Sidebar

Related Questions

I am trying to understand the practical difference during the execution of a program
Let say I have the following desire, to simplify the IConvertible's to allow me
I want the messagebox to only show if the number is equal to 0.
I'm trying to write test harness for part of my Android mapping application. I
I am attempting to pull some information from my tnsnames file using regex. I
After having read Ian Boyd 's constructor series questions ( 1 , 2 ,

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.