Bugzilla – Attachment 84972 Details for
Bug 68790
Other: Build fails on Windows when system locale is "Japanese(Japan)" .
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Patch for adding BOM to .hrc file
0001-fdo-68790.patch (text/plain), 4.09 KB, created by
Tomofumi Yagi
on 2013-08-31 14:32:22 UTC
(
hide
)
Description:
Patch for adding BOM to .hrc file
Filename:
MIME Type:
Creator:
Tomofumi Yagi
Created:
2013-08-31 14:32:22 UTC
Size:
4.09 KB
patch
obsolete
>diff --git a/l10ntools/inc/common.hxx b/l10ntools/inc/common.hxx >index 5a12bbb..047d2f4 100644 >--- a/l10ntools/inc/common.hxx >+++ b/l10ntools/inc/common.hxx >@@ -28,12 +28,14 @@ struct HandledArgs > OString m_sMergeSrc; > OString m_sLanguage; > bool m_bMergeMode; >+ bool m_bUTF8BOM; > HandledArgs() > : m_sInputFile( OString() ) > , m_sOutputFile( OString() ) > , m_sMergeSrc( OString() ) > , m_sLanguage( OString() ) > , m_bMergeMode( false ) >+ , m_bUTF8BOM( false ) > {} > }; > >diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx >index 595c027..5fb62c5 100644 >--- a/l10ntools/inc/export.hxx >+++ b/l10ntools/inc/export.hxx >@@ -228,7 +228,7 @@ private: > > public: > Export( const OString &rOutput ); >- Export(const OString &rMergeSource, const OString &rOutput, const OString &rLanguage); >+ Export(const OString &rMergeSource, const OString &rOutput, const OString &rLanguage, bool bUTF8BOM); > ~Export(); > > void Init(); >@@ -236,6 +236,8 @@ public: > void SetError() { bError = sal_True; } > sal_Bool GetError() { return bError; } > ParserQueue* pParseQueue; // public!! >+ >+ void WriteUTF8ByteOrderMarkToOutput() { *aOutput.mSimple << '\xEF' << '\xBB' << '\xBF'; } > }; > > >diff --git a/l10ntools/source/common.cxx b/l10ntools/source/common.cxx >index db86845..78274b8 100644 >--- a/l10ntools/source/common.cxx >+++ b/l10ntools/source/common.cxx >@@ -43,6 +43,10 @@ bool handleArguments( > { > nState = STATE_LANGUAGES; > } >+ else if ( OString( argv[ i ] ).toAsciiUpperCase() == "-B" ) >+ { >+ o_aHandledArgs.m_bUTF8BOM = true; >+ } > else > { > switch ( nState ) >@@ -90,12 +94,13 @@ void writeUsage(const OString& rName, const OString& rFileType) > { > std::cout > << " Syntax: " << rName.getStr() >- << " -i FileIn -o FileOut [-m DataBase] [-l Lang]\n" >+ << " -i FileIn -o FileOut [-m DataBase] [-l Lang] [-b]\n" > << " FileIn: Source files (" << rFileType.getStr() << ")\n" > << " FileOut: Destination file (*.*)\n" > << " DataBase: Mergedata (*.po)\n" > << " Lang: Restrict the handled language; one element of\n" >- << " (de, en-US, ...) or all\n"; >+ << " (de, en-US, ...) or all\n" >+ << " -b: Add UTF-8 Byte Order Mark to FileOut(use with -m option)\n"; > } > > void writePoEntry( >diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx >index b439389..8a5e0ae 100644 >--- a/l10ntools/source/export.cxx >+++ b/l10ntools/source/export.cxx >@@ -70,7 +70,8 @@ FILE * init(int argc, char ** argv) { > > if (aArgs.m_bMergeMode) { > global::exporter.reset( >- new Export(aArgs.m_sMergeSrc, aArgs.m_sOutputFile, aArgs.m_sLanguage)); >+ new Export(aArgs.m_sMergeSrc, aArgs.m_sOutputFile, >+ aArgs.m_sLanguage, aArgs.m_bUTF8BOM)); > } else { > global::exporter.reset(new Export(aArgs.m_sOutputFile)); > } >@@ -198,7 +199,7 @@ Export::Export(const OString &rOutput) > > Export::Export( > const OString &rMergeSource, const OString &rOutput, >- const OString &rLanguage ) >+ const OString &rLanguage, bool bUTF8BOM) > : > bDefine( sal_False ), > bNextMustBeDefineEOL( sal_False ), >@@ -218,6 +219,8 @@ Export::Export( > { > aOutput.mSimple = new std::ofstream(); > aOutput.mSimple->open(rOutput.getStr(), std::ios_base::out | std::ios_base::trunc); >+ >+ if ( bUTF8BOM ) WriteUTF8ByteOrderMarkToOutput(); > } > > void Export::Init() >diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk >index 55a8d57..a34df18 100644 >--- a/solenv/gbuild/AllLangResTarget.mk >+++ b/solenv/gbuild/AllLangResTarget.mk >@@ -50,9 +50,9 @@ $(call gb_Helper_abbreviate_dirs,\ > -i $(3) \ > -o $(1) \ > -m $${MERGEINPUT} \ >- -l all) && \ >+ -l all \ >+ $(if $(filter MSC,$(COM)),$(if $(strip $(gb_WITH_LANG)),-b))) && \ > rm -rf $${MERGEINPUT} >- > endef > > $(call gb_SrsPartMergeTarget_get_target,%) : $(SRCDIR)/% $(gb_Helper_MISCDUMMY) $(gb_SrsPartMergeTarget_TRANSEXDEPS)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 68790
:
84969
|
84970
| 84972 |
85353