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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:03:15+00:00 2026-06-16T12:03:15+00:00

Possible Duplicate: UTF8 problem with MySQL 5 I’m having trouble displaying German Umlaute characters

  • 0

Possible Duplicate:
UTF8 problem with MySQL 5

I’m having trouble displaying “German Umlaute” characters on a HTML page.

The actual page is saved UTF-8 without BOM encoded, has it’s UTF-8 metatag, it is requested via AJAX and I’m manually setting the response header to UTF-8, too. Still, all German characters are broken.

I also place another AJAX call for dynamic content, which is returned correctly (in Firebug), but when displayed in the browser, the Umlaute are broken again.

I can fix everything by setting iso-8859-1 in all Ajax response headers, but I thought UTF-8 can handle special characters and I wouldn’t have to mix character encoding.

Question:
Shouldn’t UTF-8 handle characters correctly? Or do I need another charset? Am I missing something obvious?

Thanks!

EDIT:
Here is a screenshot: enter image description here

Code next.

EDIT:
THis is what I’m getting back from the server:
enter image description here

And the response header also shows the content being delivered to be UTF-8
enter image description here

So from my unknowing point of view, the server response seems to be correct in UTF-8 and foreign characters showing, is it so?

The actual page is requested by Jquery Mobile, so I can’t say what’s happening there. The dynamic content, I’m doing myself. This is the call from my application controller:

var form = "",
    service = "../services/views.cfc",
    method = "byPass",
    returnformat = "json",
    targetUrl = "",
    formdata = "form_submitted=getUsers&method="+method+"&returnformat="+returnformat,
    successHandler = function(objResponse, cbk) {
        cbk( objResponse );
    };

ajaxFormSubmit( form, service, formdata, targetUrl, successHandler, "yes", "", returnformat, cbk );

which triggers:

var ajaxFormSubmit = 
    function ( form, service, formdata, targetUrl, successHandler, dataHandler, errorHandler, returnformat, type ){
    var override = null;

    if ( type !== "" && type !== "post" ){
        override = type;
        type = "get";
    }

    $.ajax({
        async: false,
        type: type == "" ? "get" : type,
        url: service,
        data: formdata,
        dataType: returnformat,
        success: function( objResponse ){
            if (objResponse.SUCCESS == true || typeof objResponse === "string" ){
                dataHandler == "yes" ? successHandler( objResponse, override ) : successHandler( override );
            } else {},  
        error: function (jqXHR, XMLHttpRequest, textStatus, errorThrown) {}
        });
    }

On the server (I’m using Coldfusion8 and MySQL 5.0.88. I’m ending up in this view:

<cffunction name="getUsers_abc" access="public" returntype="any" output="false" hint="JSON vcard library">
    <cfargument name="local" type="struct" required="true" hint="Local Object" />
    <cfscript>
        var THAT = local;
        THAT.displayStart = 0;
        THAT.displayLength = 10;
        THAT.count = 0;
        THAT.loginid = Session.id;
    </cfscript>
    <cftry>
    <!--- Database call --->
    <cfquery datasource="#Session.datasource#" name="getUsers">
        SELECT 
            tn.iln, 
            tn.typ, 
            ...
        FROM table AS Tn
        WHERE tn.freigeschaltet != "5"
        AND tn.typ = "abc"
        LIMIT #THAT.displayStart#,#THAT.displayLength# 
    </cfquery>

    <!--- CREATE JSON --->
    <cfsavecontent variable="jsonRetailers">
        <cfoutput>{"data":[</cfoutput>
            <cfloop query="getUsers">
                <cfset THAT.count = THAT.count + 1>
                    <cfoutput>
                        <cfoutput>{</cfoutput>
                            <cfoutput>"type":"#getUsers.typ#",</cfoutput>
                            ...
                            <cfoutput>}]</cfoutput>
                        <cfoutput>}</cfoutput>
                    </cfoutput>
                    <cfif getUsers.recordcount LT THAT.displayStart + THAT.displayLength>
                        <cfif THAT.count is not getUsers.recordcount><cfoutput>, </cfoutput></cfif>
                    <cfelse>
                        <cfif THAT.count LT THAT.displayLength><cfoutput>, </cfoutput></cfif>
                    </cfif>
                </cfloop>
                <cfoutput>]</cfoutput>
                <cfoutput>,"SUCCESS":true,"Count":#getUsers.recordcount#}</cfoutput>
            </cfsavecontent>
            <cfset variables.alredayBinary = "false">

            <!--- GZIP if possible --->
            <cfif cgi.HTTP_ACCEPT_ENCODING contains "gzip">
                <cfinvoke method="gzip" stringToZip="#jsonRetailers#" returnvariable="passBackObject"></cfinvoke>     
                <cfheader name="Content-Encoding" value="gzip">
                <cfset variables.alredayBinary = "true">
            </cfif>
            <!--- setting UTF-8 --->
            <cfheader name="Content-Type" value="text/json; charset=UTF-8">
            <cfheader name="Content-Length" value="#len(passBackObject)#" >
            <cfif variables.alredayBinary EQ "false">
                <!--- send to browser --->
                <cfcontent reset="no" variable="#CharsetDecode(passBackObject, "UTF-8")#" />
            <cfelse>
                <cfcontent reset="no" variable="#passBackObject#" />    
            </cfif>
            <cfreturn  />
</cffunction>

So, no PHP unfortunately. THe code is not telling me where the problem is, but maybe you see something, I don’t .

Thanks!

  • 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-06-16T12:03:16+00:00Added an answer on June 16, 2026 at 12:03 pm

    broken = they are showing as “?” question marks

    This means most likely that you are fetching the characters as latin1 in your remote script, and displaying them in a UTF-8 context. (The default encoding for Ajax requests is UTF-8.)

    Check out UTF-8 all the way through and make sure you are using UTF-8 everywhere. If the Ajax script fetches data from a database, make sure you explicitly set the encoding.

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

Sidebar

Related Questions

Possible Duplicate: Mysql server does not support 4-byte encoded utf8 characters I have a
Possible Duplicate: SET NAMES utf8 in MySQL? I am writing PHP to connect to
Possible Duplicate: Save Data in Arabic in MySQL database I have a problem with
Possible Duplicate: format xml string I'm generating an XML page like so: header('Content-Type: text/html');
Possible Duplicate: Replace html entities with the corresponding utf-8 characters in Python 2.6 What's
Possible Duplicate: How to fix double-encoded UTF8 characters (in an utf-8 table) I see
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: Looking for case insensitive MySQL collation where a != ä I'm struggling
Possible Duplicate: UTF-8 all the way through I'm trying to insert special characters (like
Possible Duplicate: Android AdMobs problem. I am trying to put in an ad but

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.