Free Support Forum - aspose.cloud

Replace text not working with Korean language

Hi,

I am using, asposewordscloud api for NodeJs, and I figure out that the PostReplaceText is not working if I want to replace character like 안녕 by something else like Hey.

Best regards,
Marc

Hi Marc,

Thanks for your inquiry. Could you please attach your input Word document here for testing? We will investigate the issue on our side and provide you more information.

Hi,

For exemple in this doc: TestAspose.docx.
With your api:
I can replace the text Bonjour by Coucou.
while
I can not replace: <!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>FR</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:10.0pt;line-height:
120%;font-family:“Gulim”,“sans-serif”;mso-bidi-font-family:Gulim;color:#5A5A5A;
mso-themecolor:text1;mso-themetint:165;mso-ansi-language:FR;mso-fareast-language:
EN-US;mso-bidi-language:EN-US” lang=“EN-US”>안돼 by Coucou.


The result is an empty string.


Best regards<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; line-height:120%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>FR</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–>


/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; line-height:120%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

Hi Marc,

Thanks for sharing the document. We have tested the scenario and have not found the shared issue. Please try again to replace the text. We have attached the output document with this post for your kind reference.

Hi,

Thank you for your answer.
But after severals test, I am still incurring this issues.

First I am replacing Bonjour by Hello => working.
And then I am replacing the 안돼 by Korean Change.

As you can see on the Image, I attached, your Api return matching. And change it.
But my output document attached as not the remplace words.

I think this is not an issue from my code because I can replace normal text and that also because your api find well the matching.

best regards.

Hi Marc,

Thanks for your inquiry. Perhaps, you are facing this issue due to trial mode of Aspose cloud services.

Could you please attach your input JSON/XML data file here for further testing? We will investigate the issue on our end and provide you more information.

Hi,
Thank you for your answer.

You will find in the test.zip a file .json.

the json is this one. And I use it to do the request with the asposewordscloud.

{
“replaceTextRequestBody”:{
“OldValue”: “안돼”,
“NewValue”: “Bonjour”
},
“file_url”: “9c6b5623708db2bb7a6adf00b6c095d7test1.pdf”
}
wordsApi.PostReplaceText(file_url, null, null, null, replaceTextRequestBody, (responseMessage) => {
if(responseMessage.code===200) res.status(responseMessage.code).send(“Document has been updated successfully”);
else res.status(responseMessage.code).send(responseMessage);
});


Best Regards,
Marc
Hi Marc,

Thanks for sharing the detail. We have tested the scenario and have not found the shared issue.

You may test your scenario using Aspose for Cloud Web API explorer. This is a collection of Swagger documentation for the Aspose for Cloud APIs. You can get information about all the resources in the API. It also provides testing and interactivity to our API endpoint documentation.

Hello,

Thank you for your answer. I tried with http://api.aspose.cloud/v1.1/swagger/ui/index#!/words/TextItems_PostReplaceText . And yeah it is working. And I make it works with your node wordsApi. (by adding IsMatchCase, IsMatchWholeWord, IsOldValueRegex) funny part is even if they are optional, they seems to be required(only with korean text). (if I put them to true or false it doesn’t matters. they just need to be there).

Now the tricky part is:
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>FR</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:10.0pt;line-height:
120%;font-family:“Gulim”,“sans-serif”;mso-bidi-font-family:Gulim;color:#5A5A5A;
mso-themecolor:text1;mso-themetint:165;mso-ansi-language:FR;mso-fareast-language:
EN-US;mso-bidi-language:EN-US” lang=“EN-US”>안돼 is working but <span style=“font-size:10.0pt;line-height:
120%;font-family:“Gulim”,“sans-serif”;mso-bidi-font-family:Gulim;color:#5A5A5A;
mso-themecolor:text1;mso-themetint:165;mso-ansi-language:FR;mso-fareast-language:
EN-US;mso-bidi-language:EN-US” lang=“EN-US”>고마워요 not with the nodeApi.
I got a 400 error:
{
“code”: 400,
“body”: {
“Message”: “Object reference not set to an instance of an object.”
},
“status”: “Bad Request”,
“error”: null
}

I know that it is working on your aspose cloud but it’s not on your nodeApi:
And it is an exemple that I wrote:
const formData = {
“OldValue”: “ㅋㅋㅋㅋㅋㅋㅋㅋ”,
“NewValue”: “Coucou”,
“IsMatchCase”: true,
“IsMatchWholeWord”: true,
“IsOldValueRegex”: true
}
wordsApi.PostReplaceText(name, null, null, null, formData, (responseMessage) => will be 400


const url=‘http://api.aspose.cloud/v1.1/words/b729b47c35e6120afc63392fff3d15c2TestAspose.docx/replaceText?appsid=3cfe4a6c-2116-4665-806c-c72ebba2a0f8&signature=2prQmK0jjqSGdYrFnG4Vq1EeG9s’;
request.post(url)
.json(formData) will be 200

So do you have any related issue with the nodeApi ?
<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; line-height:120%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

Hi Marc,

Thanks for your inquiry. We have logged this problem in our issue tracking system as EXMP-1077. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi,

May I ask you, when this problem could be solve ?

Best regards,
Marc

Hi Marc,

Thanks for your inquiry. We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. Our developers work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is pending for analysis and is in the queue. Once our product team completes the analysis of your issue, we will then be able to provide you an estimate.

Thanks for your patience and understanding.

Hi,

I have an other issue for the slide cloud api:

I am uploading this file: TestPPT.pptx.

When I am using your nodeJsAPI or cloud API get /slides/{names}/textItems (on the cloud explorer). I got this answer

{
TextItems”: {
Items”: [
{
Uri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/slides/1/shapes/1,
Relation”: “parent”,
LinkType”: null,
Title”: null
}
,
Text”: “Hello”
}
,
{
Uri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/slides/2/shapes/1,
Relation”: “parent”,
LinkType”: null,
Title”: null
}
,
Text”: “My name is marc”
}
,
{
Uri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/slides/2/shapes/2,
Relation”: “parent”,
LinkType”: null,
Title”: null
}
,
Text”: “Hehehe\rYou know”
}
,
{
Uri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/slides/3/shapes/1,
Relation”: “parent”,
LinkType”: null,
Title”: null
}
,
Text”: “”
}
,
{
Uri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/slides/3/shapes/2,
Relation”: “parent”,
LinkType”: null,
Title”: null
}
,
Text”: "\r\r\r\r, "
}
,
{
Uri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/slides/4/shapes/1,
Relation”: “parent”,
LinkType”: null,
Title”: null
}
,
Text”: “End of the test. :)”
}

]
,
SelfUri”: {
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/textItems,
Relation”: “self”,
LinkType”: null,
Title”: null
}
,
AlternateLinks”: [],
Links”: [
{
Href”: http://api.aspose.cloud/v1.1/slides/3575c46ea4db9e4e72333cd089b7e87cTestPdf.pptx/textItems,
Relation”: “self”,
LinkType”: null,
Title”: null
}

]
}
,
Code”: 200,
Status”: “OK”
}

As you can see, there is not the korean text.

Best regards

Hi,


I have observed your comments. This query is related to Aspose.Total forum. Our colleague from Aspose.Total will soon reach you to help you out in this issue.

Best Regards,

Hi Marc,


Thank you for the details. We’ve logged an investigation under ticket ID SLIDESCLOUD-276 in our issue tracking system. Your post has also been linked to this ticket. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.