<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>48463</bug_id>
          
          <creation_ts>2010-10-27 13:59:21 -0700</creation_ts>
          <short_desc>String::format() on Qt port doesn&apos;t work with utf-8</short_desc>
          <delta_ts>2019-02-03 11:12:55 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=37327</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ademar Reis">ademar</reporter>
          <assigned_to name="Ademar Reis">ademar</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>300534</commentid>
    <comment_count>0</comment_count>
    <who name="Ademar Reis">ademar</who>
    <bug_when>2010-10-27 13:59:21 -0700</bug_when>
    <thetext>String::format() on the Qt port doesn&apos;t work with utf-8 strings because it calls QString::vsprintf(), which handles cformat as a
Latin1 string by default[1] (unless changed by QTextCodec::setCodecForCStrings(), which is global and non-thread-safe).

Because of that we can&apos;t, for example, reuse the current strings in the WebKit2 LocalizationStrategy[2], not to mention potential bugs somewhere else due to this unexpected limitation.

See also bug 18994 for a long discussion on String::format() pitfalls and bug 37327 that lists several places where String::format() is used with utf-8 strings.

1. http://doc.trolltech.com/4.7/qtextcodec.html#setCodecForCStrings
2. WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>300572</commentid>
    <comment_count>1</comment_count>
    <who name="Ademar Reis">ademar</who>
    <bug_when>2010-10-27 14:23:09 -0700</bug_when>
    <thetext>I&apos;ve just noticed that the plan is to eliminate String::format() completely. See bug 30342 :-)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>