Permalink
Browse files

Changed PSpellShell to work with UTF-8 encoded text in my environment

  • Loading branch information...
goran
goran committed Mar 30, 2010
1 parent d237b5f commit 5d8430ccb116ae83218a48c0dc36088ecc250596
Showing with 1 addition and 6 deletions.
  1. +1 −6 classes/PSpellShell.php
View
@@ -44,7 +44,7 @@ function &checkWords($lang, $words) {
preg_match("/\& ([^ ]+) .*/i", $dstr, $matches);
if (!empty($matches[1]))
- $returnData[] = utf8_encode(trim($matches[1]));

This comment has been minimized.

Show comment
Hide comment
@gjuric

gjuric Mar 31, 2010

Owner

We do not need to utf8_encode an UTF-8 string.

@gjuric

gjuric Mar 31, 2010

Owner

We do not need to utf8_encode an UTF-8 string.

+ $returnData[] = trim($matches[1]);
}
return $returnData;
@@ -60,11 +60,6 @@ function &checkWords($lang, $words) {
function &getSuggestions($lang, $word) {
$cmd = $this->_getCMD($lang);
- if (function_exists("mb_convert_encoding"))
- $word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8"));

This comment has been minimized.

Show comment
Hide comment
@gjuric

gjuric Mar 31, 2010

Owner

This converts the string to ISO-8859-1 which can not display all UTF-8 characters

@gjuric

gjuric Mar 31, 2010

Owner

This converts the string to ISO-8859-1 which can not display all UTF-8 characters

- else
- $word = utf8_encode($word);

This comment has been minimized.

Show comment
Hide comment
@gjuric

gjuric Mar 31, 2010

Owner

But this on the other hand converts from ISO-8859-1 to UTF-8?!? (see note 2 lines above)

@gjuric

gjuric Mar 31, 2010

Owner

But this on the other hand converts from ISO-8859-1 to UTF-8?!? (see note 2 lines above)

-
if ($fh = fopen($this->_tmpfile, "w")) {
fwrite($fh, "!\n");
fwrite($fh, "^$word\n");

0 comments on commit 5d8430c

Please sign in to comment.