为什么Typo3网站的特殊字符没有保存到数据库?

时间:2015-07-17 04:23:44

标签: database server typo3

我有一个网站移动到我们的服务器,我已成功移动它。但我注意到一些奇怪的事情.Site不会渲染丹麦字符(只有特殊字符)。当我尝试在管理员中使用htmlarea保存时部分和我可以保存Lorem Ipsum任何问题。但特殊的丹麦字符似乎保存到数据库,但当我打开htmlarea它没有显示任何内容。

似乎我应该有一些配置或设置要做。我试图更改字符集但没有工作。然后整个数据库和表更改为Utf8.No运气。

任何人都有想法解决这个问题? 请提到地点和页面名称,因为我是typo3的新手

由于

3 个答案:

答案 0 :(得分:0)

有关typo3 ond utf8的更多信息,你可以在那里找到 - http://wiki.typo3.org/UTF-8_support(TYPO3 UTF-8支持)。你有哪个TYPO3版本?

答案 1 :(得分:0)

我认为你必须修改你的页面错别字配置。

在entryHTMLparser_db和exitHTMLparser_db时设置htmlSpecialChars = 0。

使用以下页面错别字配置。你的问题可能会得到解决。

mod.SHARED {
    defaultLanguageFlag = de
    defaultLanguageLabel = Deutsch
}

# Classes. Do not forget to define them in the CSS class
RTE.classes {

    # lists
    checklist {
        name = Checkliste
    }

    # tables
    table {
        name = Normale Tabelle
    }
    table-condensed {
        name = Verkürzte Tabelle
    }
    table-bordered {
        name = Tabelle mit Rahmen
    }
    table-styled {
        name = Tabelle mit anderem Design
    }
    table-striped {
        name = Tabelle mit Streifen
    }
    table-hover {
        name = Tabelle mit Hover-Effekt
    }

    # aligns
    align-justify {
        name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyfull
    }
    align-left {
        name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyleft
        value = text-align: left;
    }
    align-center {
        name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifycenter
        value = text-align: center;
    }
    align-right {
        name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyright
        value = text-align: right;
    }
    csc-frame-frame1 {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame1
        value = background-color: #EDEBF1; border: 1px solid #333333;
    }
    csc-frame-frame2 {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:frame-frame2
        value = background-color: #F5FFAA; border: 1px solid #333333;
    }
    important {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:important
        value = color: #8A0020;
    }
    name-of-person {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:name-of-person
        value = color: #10007B;
    }
    detail {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:detail
        value = color: #186900;
    }
    component-items {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
        value = color: #186900;
    }
    action-items {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
        value = color: #8A0020;
    }
    component-items-ordered {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:component-items
        value = color: #186900;
    }
    action-items-ordered {
        name = LLL:EXT:rtehtmlarea/res/contentcss/locallang.xml:action-items
        value = color: #8A0020;
    }

    style1 {
        name = Stil 1
    }

    htmlCode {
        name = HTML Code
    }
    phpCode {
        name = PHP Code
    }

}

RTE.classesAnchor {

    externalLink {
        class = external-link
        type = url
        titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_titleText
    }
    externalLinkInNewWindow {
        class = external-link-new-window
        type = url
        titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:external_link_new_window_titleText
    }
    internalLink {
        class = internal-link
        type = page
        titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_titleText
    }
    internalLinkInNewWindow {
        class = internal-link-new-window
        type = page
        titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:internal_link_new_window_titleText
    }
    download {
        class = download
        type = file
        titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:download_titleText
    }
    mail {
        class = mail
        type = mail
        titleText = LLL:EXT:rtehtmlarea/res/accessibilityicons/locallang.xml:mail_titleText
    }


    more-link {
        class = more-link
        type = page
        titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_titleText
        altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_altText
    }
    button-link {
        class = btn
        type = page
        titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_titleText
        altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:more_link_altText
    }
    next-link {
        class = ym-button ym-next
        type = page
        titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:next_link_titleText
        altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:next_link_altText
    }
    back-link {
        class = back-link
        type = page
        titleText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:back_link_titleText
        altText = LLL:EXT:fluxtemplate/Resources/Private/Language/locallang.xml:back_link_altText
    }
}

RTE.default {

    showButtons = *
    ## Enable the image button
    showButtons := addToList(image)

    defaultContentLanguage = de


    // Make possible to read classes from the contentCSS CSS file
    buttons.textstyle.tags.span.allowedClasses >

    buttons.textstyle.tags.REInlineTags >
    buttons.textstyle.REInlineTags >
    buttons.blockstyle.tags.table.allowedClasses >
    buttons.blockstyle.tags.p.allowedClasses >

    buttons.blockstyle.tags.div.allowedClasses = align-left, align-center, align-right
    buttons.blockstyle.tags.div.allowedClasses := addToList(csc-frame-frame1, csc-frame-frame2)
    buttons.blockstyle.tags.table.allowedClasses = csc-frame-frame1, csc-frame-frame2
    buttons.blockstyle.tags.td.allowedClasses = align-left, align-center, align-right
    buttons.textstyle.tags.span.allowedClasses = important, name-of-person, detail




    contentCSS = typo3conf/ext/fluxtemplate/Resources/Public/CSS/rte.css

    buttons.formatblock.prefixLabelWithTag = 1
    buttons.link.relAttribute.enabled = 1
    buttons.link.queryParametersSelector.enabled = 1
    buttons.link.properties.class.allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail 
    buttons.link.page.properties.class.default = internal-link
    buttons.link.url.properties.class.default = external-link-new-window
    buttons.link.file.properties.class.default = download
    buttons.link.mail.properties.class.default = mail
    buttons.image.properties.class.allowedClasses = img-responsive
    // Disable contextual menu
    contextMenu.disabled = 1

    // Display status bar
    showStatusBar = 1

    //More toolbar options
    keepButtonGroupTogether = 1

    // Use CSS formatting when possible
    useCSS = 1

    // Make rtehtmlarea resizable
    rteResize = 1



    proc {


        allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
        allowedClasses := addToList(detail,align-left, align-center, align-right, align-justify, csc-frame-frame1, csc-frame-frame2, component-items, action-items, component-items-ordered, action-items-ordered, important, name-of-person, indent, img-responsive)   

        allowedClasses  < RTE.default.classesCharacter
        # auskommentieren, damit klassen eingelesen werden können
        #allowedClasses := addToList( dimmed,highlight,box,info,success,warning,error,float-left,float-right,center,align-left,align-center,align-right,align-justify,style1 )

        ## TAGS ALLOWED OUTSIDE P & DIV
        allowTagsOutside := addToList( pre, img )

        allowTags := addToList( pre )

        // Tags allowed in Typolists
        allowTagsInTypolists = br,font,b,i,u,a,img,span

        // Keep unknown tags
        dontRemoveUnknownTags_db = 1

        // Allow tables
        preserveTables = 1

        entryHTMLparser_db = 1
        entryHTMLparser_db {

            // Tags allowed
            allowTags < RTE.default.proc.allowTags

            // Tags denied
            denyTags >

            // HTML special characters
            htmlSpecialChars = 0

            // Allow IMG tags
            tags.img >

            // Additionnal attributes for P & DIV
            tags.div.allowedAttribs = class,style,align
            tags.p.allowedAttribs = class,style,align

            // Tags to remove
            removeTags = center, font, o:p, sdfield, strike, u

            // Keep non matched tags
            keepNonMatchedTags = protect
        }

        // HTML parser
        HTMLparser_db {

            // Strip attributes
            noAttrib = br

            // XHTML compliance
            xhtml_cleaning = 1
        }

        // Exit HTML parser
        exitHTMLparser_db = 1
        exitHTMLparser_db {

            // Remap bold and italic
            tags.b.remap = strong
            tags.i.remap = em

            // Keep non matched tags
            keepNonMatchedTags = 1

            // HTML special character
            htmlSpecialChars = 0
        }


    }

}


RTE.default.FE < RTE.default
RTE.default.FE.showButtons < RTE.default.showButtons
RTE.default.FE.proc.allowTagsOutside < RTE.default.proc.allowTagsOutside
RTE.default.FE.proc.entryHTMLparser_db.tags.img >

// PageTSConfig
TCEFORM.tt_content.header_layout.altLabels  {
    0 = H1 (Default)
    1 = H1
    2 = H2
    3 = H3
    4 = H4
    5 = H5
}

答案 2 :(得分:0)

我的另一个项目也有同样的问题。

首先在php.ini文件中将default_charset设置为utf8。

或者您可以使用以下PHP代码设置它:

ini_set('default_charset', 'utf8');