Closed Bug 477577 Opened 14 years ago Closed 14 years ago

Encoding errors compiling TestAUSReadStrings.cpp


(Toolkit :: Application Update, defect)

1.9.1 Branch
Not set





(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)



(Keywords: fixed1.9.1)


(1 file)

From bug 473417 comment #89

Robert, this patch doesn't compile in all situations, your code is assuming
users are building on Latin-based versions of Windows.  Under Japanese Windows,
the compiler spits out a bunch of bad encoding errors and the compile fails.

Using UTF-8 strings directly in code like this trips up builds under Japanese
Windows, since the compiler is assuming (argh!) that source files are in the
default codepage of the system (i.e. codepage 932 (Shift-JIS) vs. 1252 (Windows

There might be a way of forcing the compiler to interpret the file as a UTF-8
file by adding a BOM but that will probably break builds on other platforms
with compilers that don't understand BOM's.  The safest way would be to simply
escape the UTF-8 strings you're using:

"Title Test - 测试 測試 Δοκιμή テスト Испытание"

would become

"Title Test - \xE6\xB5\x8B\xE8\xAF\x95 \xE6\xB8\xAC\xE8\xA9\xA6

You could also read these strings in from a file, that would give you full
control over the assumed encoding.
Attached patch patchSplinter Review
Pushed to mozilla-central
Assignee: nobody → robert.bugzilla
Attachment #361321 - Flags: review+
resolving -> fixed on trunk... will wait a cycle before pushing to mozilla-1.9.1
Closed: 14 years ago
Resolution: --- → FIXED
Pushed to mozilla-1.9.1
Keywords: fixed1.9.1
Target Milestone: --- → mozilla1.9.1b3
John, could you please verify that this works on trunk and 1.9.1 branch?
Target Milestone: mozilla1.9.1b3 → mozilla1.9.2a1
btw: Henrik, I believe the reason for setting the target milestone (from reading parts of the thread) to when it is fixed on the trunk was due to TM. As I understand it TM is no longer marking bugs landed in the TM repo as fixed and only mark the bugs as fixed after they have landed on trunk. If that is the case it seems counterintuitive to mark a bugs target milestone to a later milestone than the first milestone it actually landed for.
This is mostly off-topic but lets give a short answer... Setting the target milestone to 1.9.2a1 also applies to TM bugs. It doesn't matter in which product/component bugs resist. As what was said in the thread, the target milestone always represent the most recent milestone on trunk. And after branching for 1.9.1 this is 1.9.2a1 right now. It's really helpful for QA to have a straight handling, so sorry for all the changes Rob.
You need to log in before you can comment on or make changes to this bug.