Character set conversion G1->G2
twinprime
Joined: 2007-03-20
Posts: 3 |
![]() |
During migration from G1->G2, is there a way to have Gallery NOT convert characters on the website to UTF-8? I'm using Windows ISO to display characters of another language. Quote:
Ӓ(ampersand, pound and number and semi-colon). However during migration the program changes the ampersand to Quote:
& making it looks like an actual ampersand, thus totally break the display of special characters. Is this an option? If not where (in the gallery2 php code) should look and change to turn this off? It's really frustrating. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
it's not an option. you might want to add $utf8String = GalleryUtilities::unicodeEntitiesToUtf8($yourString); so the final code should be: so much about the theory. to fix your import module, edit modules/migrate/ConfirmImport.inc around line 1424 function convertHtml($markupType, $item, $sourceEncoding='UTF-8') { $item = GalleryCoreApi::convertToUtf8($item, $sourceEncoding); switch ($markupType) { case 'bbcode': $item = ConfirmImportController::convertHtmlToBbcode($item); break; case 'html': break; case 'none': default: $item = strip_tags($item); } GalleryUtilities::sanitizeInputValues($item, false); return $item; } with function convertHtml($markupType, $item, $sourceEncoding='UTF-8') { $item = GalleryCoreApi::convertToUtf8($item, $sourceEncoding); switch ($markupType) { case 'bbcode': $item = ConfirmImportController::convertHtmlToBbcode($item); break; case 'html': break; case 'none': default: $item = strip_tags($item); } $item = GalleryUtilities::unicodeEntitiesToUtf8($item); GalleryUtilities::sanitizeInputValues($item, false); return $item; }
-------------- |
|
twinprime
Joined: 2007-03-20
Posts: 3 |
![]() |
Thank you so very much. (You put the 2 code blocks reverse, but it's pretty obvious if you've been digging through the import script for this) |
|